Toasts

All Quick 'n Easy Web Builder support issues that are not covered in the forums below.
Post Reply
mexman
Posts: 547
Joined: Mon Feb 11, 2013 11:33 am
Location: Puebla/Mexico

Toasts

Post by mexman »

Hi Pablo:
The description to TOASTs in the help file is still very small, here a few questions:

What does the cookie related to a toast do? Does it avoid reappearance after closing the toast?

Can I trigger actions on "close toast"?

Can "close toast" be used with a link?

I want to use a toast as a "Acknowledge the page may use cookies"-message and after closing it, the user should be redirected to the main page and the toast should not appear for some time!
QnEWB V6.x - Ubuntu 18.04
User avatar
Pablo
Site Admin
Posts: 3918
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: Toasts

Post by Pablo »

Does it avoid reappearance after closing the toast?
yes
Can I trigger actions on "close toast"?
No, there no event for this.
Can "close toast" be used with a link?
No
mexman
Posts: 547
Joined: Mon Feb 11, 2013 11:33 am
Location: Puebla/Mexico

Re: Toasts

Post by mexman »

Thanks for the quick answer.
So I guess I need to build the function/message I mentioned with some other tool or can you think about any QnEWB function to use for that purpose?
QnEWB V6.x - Ubuntu 18.04
User avatar
Pablo
Site Admin
Posts: 3918
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: Toasts

Post by Pablo »

It is possible with custom code. For example:

Code: Select all

<script>
$(document).ready(function()
{
   $("#Toast1").on('hidden.bs.toast', function ()
   {
      // do something
   });
});
</script>
Note however that I cannot assist you with writing custom code.

Alternatively, you can try the dialog which does have a 'close' event.
mexman
Posts: 547
Joined: Mon Feb 11, 2013 11:33 am
Location: Puebla/Mexico

Re: Toasts

Post by mexman »

>Alternatively, you can try the dialog which does have a 'close' event.<

Just trying.... but seems that different than the Toast, the "dialog" condition will not be remembered by a cookie.... it seems to appear always.
Is this possible or am I doing something wrong?
QnEWB V6.x - Ubuntu 18.04
mexman
Posts: 547
Joined: Mon Feb 11, 2013 11:33 am
Location: Puebla/Mexico

Re: Toasts

Post by mexman »

Pablo wrote: Mon Nov 25, 2019 7:05 am It is possible with custom code. For example:

Code: Select all

<script>
$(document).ready(function()
{
   $("#Toast1").on('hidden.bs.toast', function ()
   {
      // do something
   });
});
</script>
Thanks for pointing me in this direction, but it is not working as I like to. Seems that "//do something" is fired only when the toast has being hidden by the user but not if the toast is not even shown because the cookie has not expired yet.
QnEWB V6.x - Ubuntu 18.04
User avatar
Pablo
Site Admin
Posts: 3918
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: Toasts

Post by Pablo »

Seems that "//do something" is fired only when the toast has being hidden by the user but not if the toast is not even shown because the cookie has not expired yet.
Correct.

See also:
https://getbootstrap.com/docs/4.3/components/toasts/
Post Reply