mirror of
https://github.com/Hopiu/bootstrap.git
synced 2026-05-14 15:13:09 +00:00
Remove _close() and marge with _hide()
This commit is contained in:
parent
91ebb4b3b2
commit
f4877dbf03
1 changed files with 15 additions and 18 deletions
|
|
@ -127,7 +127,21 @@ class Toast {
|
||||||
}
|
}
|
||||||
|
|
||||||
EventHandler.trigger(this._element, Event.HIDE)
|
EventHandler.trigger(this._element, Event.HIDE)
|
||||||
this._close()
|
|
||||||
|
const complete = () => {
|
||||||
|
this._element.classList.add(ClassName.HIDE)
|
||||||
|
EventHandler.trigger(this._element, Event.HIDDEN)
|
||||||
|
}
|
||||||
|
|
||||||
|
this._element.classList.remove(ClassName.SHOW)
|
||||||
|
if (this._config.animation) {
|
||||||
|
const transitionDuration = getTransitionDurationFromElement(this._element)
|
||||||
|
|
||||||
|
EventHandler.one(this._element, TRANSITION_END, complete)
|
||||||
|
emulateTransitionEnd(this._element, transitionDuration)
|
||||||
|
} else {
|
||||||
|
complete()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose() {
|
dispose() {
|
||||||
|
|
@ -172,23 +186,6 @@ class Toast {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
_close() {
|
|
||||||
const complete = () => {
|
|
||||||
this._element.classList.add(ClassName.HIDE)
|
|
||||||
EventHandler.trigger(this._element, Event.HIDDEN)
|
|
||||||
}
|
|
||||||
|
|
||||||
this._element.classList.remove(ClassName.SHOW)
|
|
||||||
if (this._config.animation) {
|
|
||||||
const transitionDuration = getTransitionDurationFromElement(this._element)
|
|
||||||
|
|
||||||
EventHandler.one(this._element, TRANSITION_END, complete)
|
|
||||||
emulateTransitionEnd(this._element, transitionDuration)
|
|
||||||
} else {
|
|
||||||
complete()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Static
|
// Static
|
||||||
|
|
||||||
static _jQueryInterface(config) {
|
static _jQueryInterface(config) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue