diff options
| author | Mark Otto <[email protected]> | 2016-06-12 21:17:14 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2016-06-12 21:17:14 -0700 |
| commit | aaad85bc306ccf35bd749ea43d2aa768e4ebabeb (patch) | |
| tree | 8011d6e04d1bb4c87356036eba55cc13639bc96a /js/dist/modal.js | |
| parent | 8feae9075ae55be4e6cd0e884fbfa006a6639ceb (diff) | |
| parent | ce2e944aa6957528f23f1f7e680ac0cb4a75dcac (diff) | |
| download | bootstrap-aaad85bc306ccf35bd749ea43d2aa768e4ebabeb.tar.xz bootstrap-aaad85bc306ccf35bd749ea43d2aa768e4ebabeb.zip | |
Merge branch 'v4-dev' of https://github.com/twbs/bootstrap into v4-dev
Diffstat (limited to 'js/dist/modal.js')
| -rw-r--r-- | js/dist/modal.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/js/dist/modal.js b/js/dist/modal.js index 84cf9835e..0ed976d4d 100644 --- a/js/dist/modal.js +++ b/js/dist/modal.js @@ -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'; } } }, { |
