diff options
Diffstat (limited to 'vendor/twbs/bootstrap/js/src/modal.js')
-rw-r--r-- | vendor/twbs/bootstrap/js/src/modal.js | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/vendor/twbs/bootstrap/js/src/modal.js b/vendor/twbs/bootstrap/js/src/modal.js index 975a20be6..2e3017024 100644 --- a/vendor/twbs/bootstrap/js/src/modal.js +++ b/vendor/twbs/bootstrap/js/src/modal.js @@ -1,6 +1,6 @@ /** * -------------------------------------------------------------------------- - * Bootstrap (v4.5.3): modal.js + * Bootstrap (v4.6.0): modal.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ @@ -15,7 +15,7 @@ import Util from './util' */ const NAME = 'modal' -const VERSION = '4.5.3' +const VERSION = '4.6.0' const DATA_KEY = 'bs.modal' const EVENT_KEY = `.${DATA_KEY}` const DATA_API_KEY = '.data-api' @@ -230,39 +230,35 @@ class Modal { } _triggerBackdropTransition() { - if (this._config.backdrop === 'static') { - const hideEventPrevented = $.Event(EVENT_HIDE_PREVENTED) + const hideEventPrevented = $.Event(EVENT_HIDE_PREVENTED) - $(this._element).trigger(hideEventPrevented) - if (hideEventPrevented.isDefaultPrevented()) { - return - } + $(this._element).trigger(hideEventPrevented) + if (hideEventPrevented.isDefaultPrevented()) { + return + } - const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight + const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight - if (!isModalOverflowing) { - this._element.style.overflowY = 'hidden' - } + if (!isModalOverflowing) { + this._element.style.overflowY = 'hidden' + } - this._element.classList.add(CLASS_NAME_STATIC) + this._element.classList.add(CLASS_NAME_STATIC) - const modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog) - $(this._element).off(Util.TRANSITION_END) + const modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog) + $(this._element).off(Util.TRANSITION_END) - $(this._element).one(Util.TRANSITION_END, () => { - this._element.classList.remove(CLASS_NAME_STATIC) - if (!isModalOverflowing) { - $(this._element).one(Util.TRANSITION_END, () => { - this._element.style.overflowY = '' - }) - .emulateTransitionEnd(this._element, modalTransitionDuration) - } - }) - .emulateTransitionEnd(modalTransitionDuration) - this._element.focus() - } else { - this.hide() - } + $(this._element).one(Util.TRANSITION_END, () => { + this._element.classList.remove(CLASS_NAME_STATIC) + if (!isModalOverflowing) { + $(this._element).one(Util.TRANSITION_END, () => { + this._element.style.overflowY = '' + }) + .emulateTransitionEnd(this._element, modalTransitionDuration) + } + }) + .emulateTransitionEnd(modalTransitionDuration) + this._element.focus() } _showElement(relatedTarget) { @@ -400,7 +396,11 @@ class Modal { return } - this._triggerBackdropTransition() + if (this._config.backdrop === 'static') { + this._triggerBackdropTransition() + } else { + this.hide() + } }) if (animate) { |