Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export function mergeOptions(initialOptions, customOptions) {
* @param {Object} styles An object containing the style to apply
*/
export function stylize(element, styles) {
if(typeof t === null || typeof t === "undefined"){
return
}
Object.keys(styles).forEach((style) => {
element.style[style] = styles[style];
});
Expand Down Expand Up @@ -176,7 +179,13 @@ export const toast = (() => {
* Hide the Toast that's currently shown.
*/
function hideToast(transitions) {
if (transitions === "" || typeof transitions === "undefined" || typeof transitions === null) {
return
}
const toastStage = getToastStage();
if (typeof toastStage === "undefined" || typeof toastStage === null || toastStage === "") {
return
}
stylize(toastStage, transitions.HIDE);

// Destroy the Toast element after animations end.
Expand Down Expand Up @@ -228,4 +237,4 @@ export const toast = (() => {
}

return { toast };
})();
})();