Fixed issue #1291 - Block escape key when creating / editing text modules.

This commit is contained in:
Martin Edenhofer 2017-07-24 13:37:04 +02:00
parent 3babd8495e
commit b7568b8ce2
2 changed files with 15 additions and 5 deletions

View file

@ -581,6 +581,9 @@
// get correct val if textbox
$.fn.ceg = function() {
var plugin = $.data(this[0], 'plugin_' + pluginName)
if (!plugin) {
return
}
return plugin.value()
}

View file

@ -43,14 +43,17 @@
this.$element.on('keydown', function (e) {
// esc
if (e.keyCode === 27) {
_this.close()
}
// navigate through item
if (_this.isActive()) {
// esc
if (e.keyCode === 27) {
e.preventDefault()
e.stopPropagation()
_this.close()
return
}
// enter
if (e.keyCode === 13) {
e.preventDefault()
@ -106,7 +109,11 @@
menu.scrollTop( menu.scrollTop() + invisibleHeight )
}
}
}
// esc
if (e.keyCode === 27) {
_this.close()
}
})