Commit 57ff6ee9 authored by ysds's avatar ysds Committed by XhmikosR
Browse files

Call hide() after `delay` time

9 merge requests!36532My v4 dev,!34086v4: Fix prevented show event disables modals with fade class from being displayed again,!33729V4 dev,!33086V4 dev,!31901Add opacity utilities,!31513Update icons.md,!30331Removed 'shrink-to-fit' from `viewport` meta,!29732V4 dev,!28937Add *-shadow classes
Showing with 6 additions and 11 deletions
+6 -11
......@@ -95,7 +95,9 @@ class Toast {
$(this._element).trigger(Event.SHOWN)
if (this._config.autohide) {
this.hide()
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)
}
this._close()
}
dispose() {
......@@ -165,7 +160,7 @@ class Toast {
$(this._element).on(
Event.CLICK_DISMISS,
Selector.DATA_DISMISS,
() => this.hide(true)
() => this.hide()
)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment