From e2778fb8fb759342705e8c04d7d445fd525c1305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Tue, 18 Jul 2023 16:03:07 +0200 Subject: [PATCH] * Fix toast when parent ID is specified --- packages/bulma/bulmawidgets.pas | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/bulma/bulmawidgets.pas b/packages/bulma/bulmawidgets.pas index 4d2c24e..4e2e1eb 100644 --- a/packages/bulma/bulmawidgets.pas +++ b/packages/bulma/bulmawidgets.pas @@ -562,8 +562,6 @@ end; procedure TToastManager.SetParentID(const Value: String); begin FParentID := Value; - if ParentID<>'' then - TBulmaToast.SetDoc(document.getElementById(ParentID)); end; @@ -749,6 +747,8 @@ Var S : String; Opts : TJSObject; aDelay : NativeInt; + parEl : TJSElement; + Begin S:=ContextualNames[Contextual]; if S<>'' then @@ -760,8 +760,13 @@ Begin aDelay:=FHideDelay; if Not AutoHide then // we let it display for 1 day aDelay:=24*3600*1000; + if (ParentID<>'') then + parEl:=document.getElementById(ParentID) + else + parEl:=document.body; Opts:=New([ - 'message', aElement, + 'appendTo', parEl, + 'message', aElement, 'type', S, 'single', single, 'animate',FAnimate,