]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
save index on keydown and check on keyup
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 2 May 2018 13:28:26 +0000 (15:28 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 2 May 2018 13:53:35 +0000 (15:53 +0200)
so that the edit window does not open again when pressing enter

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
grid/ObjectGrid.js

index 68937ceab58b495d138d203b26c1ed931a1f5421..36c873c56a3790d48a55b546db3a8ae61a72a453 100644 (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;
        }
     },