allow to hide modal on ESC
This commit is contained in:
parent
46805b7469
commit
73d0b84779
1 changed files with 2 additions and 2 deletions
|
@ -147,11 +147,11 @@
|
|||
|
||||
Modal.prototype.escape = function () {
|
||||
if (this.isShown && this.options.keyboard) {
|
||||
this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
|
||||
$(window).on('keydown.dismiss.bs.modal', $.proxy(function (e) {
|
||||
e.which == 27 && this.hide()
|
||||
}, this))
|
||||
} else if (!this.isShown) {
|
||||
this.$element.off('keydown.dismiss.bs.modal')
|
||||
$(window).off('keydown.dismiss.bs.modal')
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue