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:
authorMark Otto <markdotto@gmail.com>2017-04-02 05:18:29 +0300
committerMark Otto <markdotto@gmail.com>2017-04-02 05:18:29 +0300
commit49b6cf845d3d3bf49197a529548489f9a1a76709 (patch)
tree725316258a4fbd311fc53ece9218e0d35e7ae827 /js/dist/modal.js
parent5142de7e592abc0a791ea3465616795c91219bcc (diff)
grunt
Diffstat (limited to 'js/dist/modal.js')
-rw-r--r--js/dist/modal.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/js/dist/modal.js b/js/dist/modal.js
index 8086d2ff6d..9185ae7f2c 100644
--- a/js/dist/modal.js
+++ b/js/dist/modal.js
@@ -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);