diff --git a/src/toastr.js b/src/toastr.js index 24b126c..d226f23 100644 --- a/src/toastr.js +++ b/src/toastr.js @@ -39,11 +39,14 @@ if (arguments.length === 1 && !toast) { return; } if (toast) { - remove(toast.toastId); - } else { - for (var i = 0; i < toasts.length; i++) { - remove(toasts[i].toastId); + if (!Array.isArray(toast)) { + toast = [ toast ]; } + } else { + toast = toasts; + } + for (var i = 0; i < toast.length; i++) { + remove(toast[i].toastId); } } @@ -83,6 +86,9 @@ if (toast.scope.options.onHidden) { toast.scope.options.onHidden(!!wasClicked, toast); } + if (toast.el) { + toast.el.html(""); + } toast.scope.$destroy(); var index = toasts.indexOf(toast); delete openToasts[toast.scope.message];