From: Dominik Csapak Date: Wed, 2 May 2018 13:28:26 +0000 (+0200) Subject: save index on keydown and check on keyup X-Git-Url: https://git.proxmox.com/?p=proxmox-widget-toolkit.git;a=commitdiff_plain;h=ce9a0f27cd87c2f71183d9b8a89ae7dbf2ff199f 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 --- diff --git a/grid/ObjectGrid.js b/grid/ObjectGrid.js index 68937ce..36c873c 100644 --- a/grid/ObjectGrid.js +++ b/grid/ObjectGrid.js @@ -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; } },