mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-09-19 01:59:06 +02:00
* Fix toast when parent ID is specified
This commit is contained in:
parent
85da3bc708
commit
e2778fb8fb
@ -562,8 +562,6 @@ end;
|
|||||||
procedure TToastManager.SetParentID(const Value: String);
|
procedure TToastManager.SetParentID(const Value: String);
|
||||||
begin
|
begin
|
||||||
FParentID := Value;
|
FParentID := Value;
|
||||||
if ParentID<>'' then
|
|
||||||
TBulmaToast.SetDoc(document.getElementById(ParentID));
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -749,6 +747,8 @@ Var
|
|||||||
S : String;
|
S : String;
|
||||||
Opts : TJSObject;
|
Opts : TJSObject;
|
||||||
aDelay : NativeInt;
|
aDelay : NativeInt;
|
||||||
|
parEl : TJSElement;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
S:=ContextualNames[Contextual];
|
S:=ContextualNames[Contextual];
|
||||||
if S<>'' then
|
if S<>'' then
|
||||||
@ -760,8 +760,13 @@ Begin
|
|||||||
aDelay:=FHideDelay;
|
aDelay:=FHideDelay;
|
||||||
if Not AutoHide then // we let it display for 1 day
|
if Not AutoHide then // we let it display for 1 day
|
||||||
aDelay:=24*3600*1000;
|
aDelay:=24*3600*1000;
|
||||||
|
if (ParentID<>'') then
|
||||||
|
parEl:=document.getElementById(ParentID)
|
||||||
|
else
|
||||||
|
parEl:=document.body;
|
||||||
Opts:=New([
|
Opts:=New([
|
||||||
'message', aElement,
|
'appendTo', parEl,
|
||||||
|
'message', aElement,
|
||||||
'type', S,
|
'type', S,
|
||||||
'single', single,
|
'single', single,
|
||||||
'animate',FAnimate,
|
'animate',FAnimate,
|
||||||
|
Loading…
Reference in New Issue
Block a user