mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-18 03:11:19 +02:00
grunt
This commit is contained in:
13
js/dist/modal.js
vendored
13
js/dist/modal.js
vendored
@@ -89,7 +89,6 @@ var Modal = function ($) {
|
||||
this._isShown = false;
|
||||
this._isBodyOverflowing = false;
|
||||
this._ignoreBackdropClick = false;
|
||||
this._isTransitioning = false;
|
||||
this._originalBodyPadding = 0;
|
||||
this._scrollbarWidth = 0;
|
||||
}
|
||||
@@ -106,12 +105,13 @@ var Modal = function ($) {
|
||||
var _this = this;
|
||||
|
||||
if (this._isTransitioning) {
|
||||
throw new Error('Modal is transitioning');
|
||||
return;
|
||||
}
|
||||
|
||||
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
|
||||
this._isTransitioning = true;
|
||||
}
|
||||
|
||||
var showEvent = $.Event(Event.SHOW, {
|
||||
relatedTarget: relatedTarget
|
||||
});
|
||||
@@ -156,16 +156,18 @@ var Modal = function ($) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
if (this._isTransitioning) {
|
||||
throw new Error('Modal is transitioning');
|
||||
if (this._isTransitioning || !this._isShown) {
|
||||
return;
|
||||
}
|
||||
|
||||
var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
|
||||
|
||||
if (transition) {
|
||||
this._isTransitioning = true;
|
||||
}
|
||||
|
||||
var hideEvent = $.Event(Event.HIDE);
|
||||
|
||||
$(this._element).trigger(hideEvent);
|
||||
|
||||
if (!this._isShown || hideEvent.isDefaultPrevented()) {
|
||||
@@ -185,6 +187,7 @@ var Modal = function ($) {
|
||||
$(this._dialog).off(Event.MOUSEDOWN_DISMISS);
|
||||
|
||||
if (transition) {
|
||||
|
||||
$(this._element).one(Util.TRANSITION_END, function (event) {
|
||||
return _this2._hideModal(event);
|
||||
}).emulateTransitionEnd(TRANSITION_DURATION);
|
||||
@@ -305,7 +308,7 @@ var Modal = function ($) {
|
||||
var _this7 = this;
|
||||
|
||||
this._element.style.display = 'none';
|
||||
this._element.setAttribute('aria-hidden', 'true');
|
||||
this._element.setAttribute('aria-hidden', true);
|
||||
this._isTransitioning = false;
|
||||
this._showBackdrop(function () {
|
||||
$(document.body).removeClass(ClassName.OPEN);
|
||||
|
Reference in New Issue
Block a user