mirror of
https://github.com/twbs/bootstrap.git
synced 2025-10-01 15:56:45 +02:00
committed by
XhmikosR
parent
0f0a8c364d
commit
6daae47cc0
@@ -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