[FIX] monkey around keyboard handling to ensure we don't cancel a cancelled edition or any other such thing.

maybe the form should be explicitly blurred when saved/cancelled?

bzr revid: xmo@openerp.com-20120710143323-fye927s9k455mqls
This commit is contained in:
Xavier Morel 2012-07-10 16:33:23 +02:00
parent 46da3547ca
commit 52723ef052
1 changed files with 2 additions and 0 deletions

View File

@ -365,6 +365,7 @@ openerp.web.list_editable = function (instance) {
});
},
keyup_ENTER: function () {
if (!this.editor.isEditing()) { return; }
var self = this;
return this.saveEdition().pipe(function (saveInfo) {
if (saveInfo.created) {
@ -375,6 +376,7 @@ openerp.web.list_editable = function (instance) {
});
},
keyup_ESCAPE: function () {
if (!this.editor.isEditing()) { return; }
return this.cancelEdition();
}
});