Call hide() after delay time
This commit is contained in:
parent
77973cd7fb
commit
57ff6ee9ef
1 changed files with 6 additions and 11 deletions
|
|
@ -95,7 +95,9 @@ class Toast {
|
|||
$(this._element).trigger(Event.SHOWN)
|
||||
|
||||
if (this._config.autohide) {
|
||||
this._timeout = setTimeout(() => {
|
||||
this.hide()
|
||||
}, this._config.delay)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -112,20 +114,13 @@ class Toast {
|
|||
}
|
||||
}
|
||||
|
||||
hide(withoutTimeout) {
|
||||
hide() {
|
||||
if (!this._element.classList.contains(ClassName.SHOW)) {
|
||||
return
|
||||
}
|
||||
|
||||
$(this._element).trigger(Event.HIDE)
|
||||
|
||||
if (withoutTimeout) {
|
||||
this._close()
|
||||
} else {
|
||||
this._timeout = setTimeout(() => {
|
||||
this._close()
|
||||
}, this._config.delay)
|
||||
}
|
||||
}
|
||||
|
||||
dispose() {
|
||||
|
|
@ -165,7 +160,7 @@ class Toast {
|
|||
$(this._element).on(
|
||||
Event.CLICK_DISMISS,
|
||||
Selector.DATA_DISMISS,
|
||||
() => this.hide(true)
|
||||
() => this.hide()
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue