[pve-devel] applied: [PATCH widget-toolkit] save index on keydown and check on keyup

Thomas Lamprecht t.lamprecht at proxmox.com
Wed May 2 15:54:33 CEST 2018


applied

On 5/2/18 3:28 PM, Dominik Csapak wrote:
> so that the edit window does not open again when pressing enter
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  grid/ObjectGrid.js | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> 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;
>  	}
>      },
>  
> 



More information about the pve-devel mailing list