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:
authorGeoSot <geo.sotis@gmail.com>2021-04-11 02:27:18 +0300
committerMark Otto <otto@github.com>2021-05-10 23:59:55 +0300
commit90b1a6907ed7bb3397fe6bd223f09eb12122d7a3 (patch)
treed666c155808a77ee51ab2296f549279b8f88873e /js/src/alert.js
parent9106d2a0eaa53a58d6cf6eef7250634329578843 (diff)
Merge js-components 'transitionend' listener callbacks into one method
Diffstat (limited to 'js/src/alert.js')
-rw-r--r--js/src/alert.js15
1 files changed, 3 insertions, 12 deletions
diff --git a/js/src/alert.js b/js/src/alert.js
index 884041580c..8d0838737a 100644
--- a/js/src/alert.js
+++ b/js/src/alert.js
@@ -7,9 +7,7 @@
import {
defineJQueryPlugin,
- emulateTransitionEnd,
- getElementFromSelector,
- getTransitionDurationFromElement
+ getElementFromSelector
} from './util/index'
import Data from './dom/data'
import EventHandler from './dom/event-handler'
@@ -75,15 +73,8 @@ class Alert extends BaseComponent {
_removeElement(element) {
element.classList.remove(CLASS_NAME_SHOW)
- if (!element.classList.contains(CLASS_NAME_FADE)) {
- this._destroyElement(element)
- return
- }
-
- const transitionDuration = getTransitionDurationFromElement(element)
-
- EventHandler.one(element, 'transitionend', () => this._destroyElement(element))
- emulateTransitionEnd(element, transitionDuration)
+ const isAnimated = element.classList.contains(CLASS_NAME_FADE)
+ this._queueCallback(() => this._destroyElement(element), element, isAnimated)
}
_destroyElement(element) {