-
-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Choose Between Displaying Multiple Toasts Or Just One #108
base: master
Are you sure you want to change the base?
Choose Between Displaying Multiple Toasts Or Just One #108
Commits on Aug 31, 2022
-
Updated Toastify class variables and show/hide functions to support t…
…he use of only a single toast at a time I still need to test the code, but the basics are there. The class Toastify will have a class variable multiple, and when set to false, will only allow one toast to appear on the screen at a time. To accomplish this, there is a class variable activeToasts that is an array of all the toasts that are currently shown on the screen. In the showToast function, check if the multiple variable is false, if it is, call the hideToast function on each toast that is showing, then add the current toast to the activeToasts array. In hideToast, we now also remove the current toast from the activeToasts array.
Configuration menu - View commit details
-
Copy full SHA for dbad7ee - Browse repository at this point
Copy the full SHA dbad7eeView commit details -
The code added in toastify-es.js was also put in toastify.js
Looking at the code again, I am not sure what toastiy-es.js is used for, but I figured it wouldnt hurt to add the code to both files.
Configuration menu - View commit details
-
Copy full SHA for 464757b - Browse repository at this point
Copy the full SHA 464757bView commit details -
Added the UI for the toggle multi-toast to the demo
Only the UI is finished, currently toggling does nothing, but that will change soon.
Configuration menu - View commit details
-
Copy full SHA for 53292be - Browse repository at this point
Copy the full SHA 53292beView commit details
Commits on Sep 1, 2022
-
Updated Toastify class variables and show/hide functions to support t…
…he use of only a single toast at a time I still need to test the code, but the basics are there. The class Toastify will have a class variable multiple, and when set to false, will only allow one toast to appear on the screen at a time. To accomplish this, there is a class variable activeToasts that is an array of all the toasts that are currently shown on the screen. In the showToast function, check if the multiple variable is false, if it is, call the hideToast function on each toast that is showing, then add the current toast to the activeToasts array. In hideToast, we now also remove the current toast from the activeToasts array.
Configuration menu - View commit details
-
Copy full SHA for bcbfd69 - Browse repository at this point
Copy the full SHA bcbfd69View commit details -
The code added in toastify-es.js was also put in toastify.js
Looking at the code again, I am not sure what toastiy-es.js is used for, but I figured it wouldnt hurt to add the code to both files.
Configuration menu - View commit details
-
Copy full SHA for 42f0d99 - Browse repository at this point
Copy the full SHA 42f0d99View commit details -
Fixed type and added function in script.js that toggles Toastify.mult…
…iple when a checkbox is clicked There is a small bug, if I declare Toastify.multiple = true to start, then later switch it to false, it will allow 2 toasts on the screen at the same time. But it works as expected if Toast.multiple = false is set from the start... I will look into this bug
Configuration menu - View commit details
-
Copy full SHA for 5fa5714 - Browse repository at this point
Copy the full SHA 5fa5714View commit details -
Bug fixed - Correctly displaying 1 toast at a time instead of 2 when …
…Toastify.multiple = false In my previous commit I mentioned there was a bug where more than one toast would appear even when Toastify.multiple = false. This is because I thought that the hideToast() function was called every time a toast "ended". After looking into it, it is actually the "removeElement" function that gets called everytime, so I moved my code to that function and now everything is running how it should.
Configuration menu - View commit details
-
Copy full SHA for 90d7353 - Browse repository at this point
Copy the full SHA 90d7353View commit details -
Configuration menu - View commit details
-
Copy full SHA for 946a731 - Browse repository at this point
Copy the full SHA 946a731View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8da3d6c - Browse repository at this point
Copy the full SHA 8da3d6cView commit details