diff options
| author | Mark Otto <[email protected]> | 2016-10-16 19:46:47 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2016-10-16 19:46:47 -0700 |
| commit | b4cdccba84f7681e2911d307828c5ce94c856736 (patch) | |
| tree | f8e1edddbd941adb255766889019248ffa399d0a /js/src/modal.js | |
| parent | 05bdecd0b09a007ae949f49fdff9006650c06969 (diff) | |
| parent | 6d6538fc81ebdb9e29ca5a5a4e8e5768b9358fe9 (diff) | |
| download | bootstrap-b4cdccba84f7681e2911d307828c5ce94c856736.tar.xz bootstrap-b4cdccba84f7681e2911d307828c5ce94c856736.zip | |
Merge branch 'v4-dev' into v4-navbars
Diffstat (limited to 'js/src/modal.js')
| -rw-r--r-- | js/src/modal.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/js/src/modal.js b/js/src/modal.js index 695ac569b..ebd3e4a34 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -3,7 +3,7 @@ import Util from './util' /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-alpha.2): modal.js + * Bootstrap (v4.0.0-alpha.4): modal.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -18,13 +18,14 @@ const Modal = (($) => { */ const NAME = 'modal' - const VERSION = '4.0.0-alpha.2' + const VERSION = '4.0.0-alpha.4' const DATA_KEY = 'bs.modal' const EVENT_KEY = `.${DATA_KEY}` const DATA_API_KEY = '.data-api' const JQUERY_NO_CONFLICT = $.fn[NAME] const TRANSITION_DURATION = 300 const BACKDROP_TRANSITION_DURATION = 150 + const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key const Default = { backdrop : true, @@ -271,7 +272,7 @@ const Modal = (($) => { _setEscapeEvent() { if (this._isShown && this._config.keyboard) { $(this._element).on(Event.KEYDOWN_DISMISS, (event) => { - if (event.which === 27) { + if (event.which === ESCAPE_KEYCODE) { this.hide() } }) @@ -400,7 +401,7 @@ const Modal = (($) => { } if (this._isBodyOverflowing && !isModalOverflowing) { - this._element.style.paddingRight = `${this._scrollbarWidth}px~` + this._element.style.paddingRight = `${this._scrollbarWidth}px` } } |
