mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-05 16:42:29 +03:00
committed by
XhmikosR
parent
0f0a8c364d
commit
6daae47cc0
+5
-2
@@ -325,9 +325,12 @@ class Modal {
|
||||
}
|
||||
|
||||
_setEscapeEvent() {
|
||||
if (this._isShown && this._config.keyboard) {
|
||||
if (this._isShown) {
|
||||
$(this._element).on(Event.KEYDOWN_DISMISS, (event) => {
|
||||
if (event.which === ESCAPE_KEYCODE) {
|
||||
if (this._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||
event.preventDefault()
|
||||
this.hide()
|
||||
} else if (!this._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||
this._triggerBackdropTransition()
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user