[FIX] [ESC] key closing dialogs when editing a list
bzr revid: xmo@openerp.com-20121031140641-l1nf68jxiye8fyi8
This commit is contained in:
parent
e9d00c7148
commit
b6af4f22cb
|
@ -410,15 +410,15 @@ openerp.web.list_editable = function (instance) {
|
|||
});
|
||||
|
||||
this.editor.$el.on('keyup keydown', function (e) {
|
||||
if (!self.editor.is_editing()) { return; }
|
||||
if (!self.editor.is_editing()) { return true; }
|
||||
var key = _($.ui.keyCode).chain()
|
||||
.map(function (v, k) { return {name: k, code: v}; })
|
||||
.find(function (o) { return o.code === e.which; })
|
||||
.value();
|
||||
if (!key) { return; }
|
||||
if (!key) { return true; }
|
||||
var method = e.type + '_' + key.name;
|
||||
if (!(method in self)) { return; }
|
||||
self[method](e);
|
||||
if (!(method in self)) { return true; }
|
||||
return self[method](e);
|
||||
});
|
||||
},
|
||||
/**
|
||||
|
@ -446,7 +446,10 @@ openerp.web.list_editable = function (instance) {
|
|||
keyup_ENTER: function () {
|
||||
return this._next();
|
||||
},
|
||||
keyup_ESCAPE: function () {
|
||||
keydown_ESCAPE: function (e) {
|
||||
return false;
|
||||
},
|
||||
keyup_ESCAPE: function (e) {
|
||||
return this.cancel_edition();
|
||||
},
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue