* clear timeout before showing the toast
* Add unit test
* Remove the check for timeout
* Check for clearTimeout to have been called
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
# Conflicts:
# js/tests/unit/toast.spec.js
return
}
+ this._clearTimeout()
+
if (this._config.animation) {
this._element.classList.add(CLASS_NAME_FADE)
}
}
dispose() {
- clearTimeout(this._timeout)
- this._timeout = null
+ this._clearTimeout()
if (this._element.classList.contains(CLASS_NAME_SHOW)) {
this._element.classList.remove(CLASS_NAME_SHOW)
}
}
+ _clearTimeout() {
+ clearTimeout(this._timeout)
+ this._timeout = null
+ }
+
// Static
static _jQueryInterface(config) {