]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Remove _close() and marge with _hide()
authorysds <ysds.code@gmail.com>
Tue, 9 Apr 2019 11:12:05 +0000 (20:12 +0900)
committerJohann-S <johann.servoire@gmail.com>
Tue, 9 Apr 2019 11:59:41 +0000 (13:59 +0200)
js/src/toast.js

index 837c5dffb13e59d477d9eb217f685cffbd9705eb..7548befd827019d10af7fd9225b74361f3f87089 100644 (file)
@@ -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) {