2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-02 16:04:07 +03:00

Merge js-components 'transitionend' listener callbacks into one method

This commit is contained in:
GeoSot
2021-04-11 02:27:18 +03:00
committed by Mark Otto
parent 9106d2a0ea
commit 90b1a6907e
9 changed files with 47 additions and 107 deletions
+1 -6
View File
@@ -7,9 +7,7 @@
import {
defineJQueryPlugin,
emulateTransitionEnd,
getElementFromSelector,
getTransitionDurationFromElement,
isDisabled,
reflow
} from './util/index'
@@ -125,11 +123,8 @@ class Tab extends BaseComponent {
const complete = () => this._transitionComplete(element, active, callback)
if (active && isTransitioning) {
const transitionDuration = getTransitionDurationFromElement(active)
active.classList.remove(CLASS_NAME_SHOW)
EventHandler.one(active, 'transitionend', complete)
emulateTransitionEnd(active, transitionDuration)
this._queueCallback(complete, element, true)
} else {
complete()
}