aboutsummaryrefslogtreecommitdiff
path: root/js/src/modal.js
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2016-06-02 21:48:53 -0700
committerMark Otto <[email protected]>2016-06-02 21:48:53 -0700
commit8feae9075ae55be4e6cd0e884fbfa006a6639ceb (patch)
tree0124594afc748b650fbe2f840b1e8d4cabc841cf /js/src/modal.js
parent96835e1512631a1a54e99e1179e06d2e23060705 (diff)
parent0b4187d37b8fb1a65a5929329b51b04a2d6aa1eb (diff)
downloadbootstrap-8feae9075ae55be4e6cd0e884fbfa006a6639ceb.tar.xz
bootstrap-8feae9075ae55be4e6cd0e884fbfa006a6639ceb.zip
Merge branch 'v4-dev' of https://github.com/twbs/bootstrap into v4-dev
Diffstat (limited to 'js/src/modal.js')
-rw-r--r--js/src/modal.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/js/src/modal.js b/js/src/modal.js
index 695ac569b..bf0a7608f 100644
--- a/js/src/modal.js
+++ b/js/src/modal.js
@@ -25,6 +25,7 @@ const Modal = (($) => {
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`
}
}