diff options
| author | GeoSot <[email protected]> | 2021-04-11 02:27:18 +0300 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2021-05-10 13:59:55 -0700 |
| commit | 90b1a6907ed7bb3397fe6bd223f09eb12122d7a3 (patch) | |
| tree | d666c155808a77ee51ab2296f549279b8f88873e /js/src/modal.js | |
| parent | 9106d2a0eaa53a58d6cf6eef7250634329578843 (diff) | |
| download | bootstrap-90b1a6907ed7bb3397fe6bd223f09eb12122d7a3.tar.xz bootstrap-90b1a6907ed7bb3397fe6bd223f09eb12122d7a3.zip | |
Merge js-components 'transitionend' listener callbacks into one method
Diffstat (limited to 'js/src/modal.js')
| -rw-r--r-- | js/src/modal.js | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/js/src/modal.js b/js/src/modal.js index 773e4263f..6701c896f 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -176,14 +176,7 @@ class Modal extends BaseComponent { EventHandler.off(this._element, EVENT_CLICK_DISMISS) EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS) - if (isAnimated) { - const transitionDuration = getTransitionDurationFromElement(this._element) - - EventHandler.one(this._element, 'transitionend', event => this._hideModal(event)) - emulateTransitionEnd(this._element, transitionDuration) - } else { - this._hideModal() - } + this._queueCallback(() => this._hideModal(), this._element, isAnimated) } dispose() { @@ -271,14 +264,7 @@ class Modal extends BaseComponent { }) } - if (isAnimated) { - const transitionDuration = getTransitionDurationFromElement(this._dialog) - - EventHandler.one(this._dialog, 'transitionend', transitionComplete) - emulateTransitionEnd(this._dialog, transitionDuration) - } else { - transitionComplete() - } + this._queueCallback(transitionComplete, this._dialog, isAnimated) } _enforceFocus() { |
