Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to close a single toast, as well as all of them? #10

Open
backspacerhino opened this issue Oct 5, 2018 · 2 comments
Open

How to close a single toast, as well as all of them? #10

backspacerhino opened this issue Oct 5, 2018 · 2 comments

Comments

@backspacerhino
Copy link

As the title says, how can I close a specific toast or all of them if I need?

I've tried
this.$toast.remove();
this.$toast.hide();
I've tried searching inside the izi-toast.js for the function but there doesn't seem to be one

@lucascnunes
Copy link

lucascnunes commented Feb 1, 2019

Using the main library as reference: http://izitoast.marcelodolza.com/#Methods

To destroy all you use:
iziToast.destroy();
I tried:
this.$toast.destroy();
worked

To hide an specific toast you must reference it with a class and use:
var toast = document.querySelector('.iziToast'); // Selector of your toast
iziToast.hide({}, toast);
// Or make new settings
iziToast.hide({
   transitionOut: 'fadeOutUp'
}, toast);
could not make work

@arthurvasconcelos
Copy link
Owner

Hi, @eiipaw I investigate on this and maybe if necessary I can implement a hideAll method.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants