aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
Diffstat (limited to 'js/src')
-rw-r--r--js/src/toast.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/js/src/toast.js b/js/src/toast.js
index 623e89771..cca6d553b 100644
--- a/js/src/toast.js
+++ b/js/src/toast.js
@@ -91,6 +91,8 @@ class Toast {
return
}
+ this._clearTimeout()
+
if (this._config.animation) {
this._element.classList.add(CLASS_NAME_FADE)
}
@@ -149,8 +151,7 @@ class Toast {
}
dispose() {
- clearTimeout(this._timeout)
- this._timeout = null
+ this._clearTimeout()
if (this._element.classList.contains(CLASS_NAME_SHOW)) {
this._element.classList.remove(CLASS_NAME_SHOW)
@@ -186,6 +187,11 @@ class Toast {
)
}
+ _clearTimeout() {
+ clearTimeout(this._timeout)
+ this._timeout = null
+ }
+
// Static
static jQueryInterface(config) {