1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-10 15:44:51 +02:00
[ci skip]
This commit is contained in:
Chris Rebert
2016-06-04 18:21:15 -07:00
parent eb350d1a7c
commit 0f3d427bbd
35 changed files with 176 additions and 87 deletions

7
js/dist/modal.js vendored
View File

@@ -27,6 +27,7 @@ var Modal = (function ($) {
var JQUERY_NO_CONFLICT = $.fn[NAME];
var TRANSITION_DURATION = 300;
var BACKDROP_TRANSITION_DURATION = 150;
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
var Default = {
backdrop: true,
@@ -222,6 +223,7 @@ var Modal = (function ($) {
}
this._element.style.display = 'block';
this._element.removeAttribute('aria-hidden');
this._element.scrollTop = 0;
if (transition) {
@@ -270,7 +272,7 @@ var Modal = (function ($) {
if (this._isShown && this._config.keyboard) {
$(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
if (event.which === 27) {
if (event.which === ESCAPE_KEYCODE) {
_this4.hide();
}
});
@@ -293,6 +295,7 @@ var Modal = (function ($) {
var _this5 = this;
this._element.style.display = 'none';
this._element.setAttribute('aria-hidden', 'true');
this._showBackdrop(function () {
$(document.body).removeClass(ClassName.OPEN);
_this5._resetAdjustments();
@@ -398,7 +401,7 @@ var Modal = (function ($) {
}
if (this._isBodyOverflowing && !isModalOverflowing) {
this._element.style.paddingRight = this._scrollbarWidth + 'px~';
this._element.style.paddingRight = this._scrollbarWidth + 'px';
}
}
}, {