mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-17 19:06:40 +02:00
Call hide() after delay
time
This commit is contained in:
@@ -103,7 +103,9 @@ class Toast {
|
|||||||
EventHandler.trigger(this._element, Event.SHOWN)
|
EventHandler.trigger(this._element, Event.SHOWN)
|
||||||
|
|
||||||
if (this._config.autohide) {
|
if (this._config.autohide) {
|
||||||
this.hide()
|
this._timeout = setTimeout(() => {
|
||||||
|
this.hide()
|
||||||
|
}, this._config.delay)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,20 +121,13 @@ class Toast {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hide(withoutTimeout) {
|
hide() {
|
||||||
if (!this._element.classList.contains(ClassName.SHOW)) {
|
if (!this._element.classList.contains(ClassName.SHOW)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
EventHandler.trigger(this._element, Event.HIDE)
|
EventHandler.trigger(this._element, Event.HIDE)
|
||||||
|
this._close()
|
||||||
if (withoutTimeout) {
|
|
||||||
this._close()
|
|
||||||
} else {
|
|
||||||
this._timeout = setTimeout(() => {
|
|
||||||
this._close()
|
|
||||||
}, this._config.delay)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose() {
|
dispose() {
|
||||||
@@ -173,7 +168,7 @@ class Toast {
|
|||||||
this._element,
|
this._element,
|
||||||
Event.CLICK_DISMISS,
|
Event.CLICK_DISMISS,
|
||||||
Selector.DATA_DISMISS,
|
Selector.DATA_DISMISS,
|
||||||
() => this.hide(true)
|
() => this.hide()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user