Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorysds <ysds.code@gmail.com>2019-04-09 14:12:05 +0300
committerJohann-S <johann.servoire@gmail.com>2019-04-09 14:59:41 +0300
commitf4877dbf034e3f3f85d01fb7414569a44aff2976 (patch)
tree08410e137079c1c6a2b773d152ce5e75acf5890b /js/src/toast.js
parent91ebb4b3b2c1a4d5bdb22b927e013ba8202303d3 (diff)
Remove _close() and marge with _hide()
Diffstat (limited to 'js/src/toast.js')
-rw-r--r--js/src/toast.js33
1 files changed, 15 insertions, 18 deletions
diff --git a/js/src/toast.js b/js/src/toast.js
index 837c5dffb1..7548befd82 100644
--- a/js/src/toast.js
+++ b/js/src/toast.js
@@ -127,7 +127,21 @@ class Toast {
}
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() {
@@ -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 _jQueryInterface(config) {