allow to hide modal on ESC
This commit is contained in:
parent
46805b7469
commit
73d0b84779
|
@ -147,11 +147,11 @@
|
||||||
|
|
||||||
Modal.prototype.escape = function () {
|
Modal.prototype.escape = function () {
|
||||||
if (this.isShown && this.options.keyboard) {
|
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()
|
e.which == 27 && this.hide()
|
||||||
}, this))
|
}, this))
|
||||||
} else if (!this.isShown) {
|
} else if (!this.isShown) {
|
||||||
this.$element.off('keydown.dismiss.bs.modal')
|
$(window).off('keydown.dismiss.bs.modal')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue