save index on keydown and check on keyup

so that the edit window does not open again when pressing enter

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2018-05-02 15:28:26 +02:00 committed by Thomas Lamprecht
parent 41670d25b5
commit ce9a0f27cd

View File

@ -225,10 +225,17 @@ Ext.define('Proxmox.grid.ObjectGrid', {
},
listeners: {
itemkeyup: function(view, record, item, index, e) {
itemkeydown: function(view, record, item, index, e) {
if (e.getKey() === e.ENTER) {
this.pressedIndex = index;
}
},
itemkeyup: function(view, record, item, index, e) {
if (e.getKey() === e.ENTER && index == this.pressedIndex) {
this.run_editor();
}
this.pressedIndex = undefined;
}
},