From 8cd96756d338b0c00f01f15b413e794d557b870b Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Wed, 7 Feb 2018 10:11:22 +0100 Subject: [PATCH] fix edit button for some panels when using the 'run_editor' function provided by the ObjectGrid, we have to make sure the function runs in the context of the grid, not in that of the button, else we cannot access the selectionModel/rows/etc. of the grid this happened with the switch to the widget toolkit Signed-off-by: Dominik Csapak Reviewed-by: Thomas Lamprecht Tested-by: Thomas Lamprecht --- www/manager6/grid/FirewallOptions.js | 2 +- www/manager6/lxc/Options.js | 2 +- www/manager6/lxc/Resources.js | 2 +- www/manager6/qemu/Options.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/www/manager6/grid/FirewallOptions.js b/www/manager6/grid/FirewallOptions.js index 87f6790c..819ebb8d 100644 --- a/www/manager6/grid/FirewallOptions.js +++ b/www/manager6/grid/FirewallOptions.js @@ -116,7 +116,7 @@ Ext.define('PVE.FirewallOptions', { var edit_btn = new Ext.Button({ text: gettext('Edit'), disabled: true, - handler: me.run_editor + handler: function() { me.run_editor(); } }); var set_button_status = function() { diff --git a/www/manager6/lxc/Options.js b/www/manager6/lxc/Options.js index 0633f9f1..3a9959fe 100644 --- a/www/manager6/lxc/Options.js +++ b/www/manager6/lxc/Options.js @@ -149,7 +149,7 @@ Ext.define('PVE.lxc.Options', { var rowdef = rows[rec.data.key]; return !!rowdef.editor; }, - handler: me.run_editor + handler: function() { me.run_editor(); } }); Ext.apply(me, { diff --git a/www/manager6/lxc/Resources.js b/www/manager6/lxc/Resources.js index 58482779..d2835a27 100644 --- a/www/manager6/lxc/Resources.js +++ b/www/manager6/lxc/Resources.js @@ -154,7 +154,7 @@ Ext.define('PVE.lxc.RessourceView', { var rowdef = rows[rec.data.key]; return !!rowdef.editor; }, - handler: me.run_editor + handler: function() { me.run_editor(); } }); var resize_btn = new Proxmox.button.Button({ diff --git a/www/manager6/qemu/Options.js b/www/manager6/qemu/Options.js index 5b8b5dc4..6f0b2511 100644 --- a/www/manager6/qemu/Options.js +++ b/www/manager6/qemu/Options.js @@ -304,7 +304,7 @@ Ext.define('PVE.qemu.Options', { var edit_btn = new Ext.Button({ text: gettext('Edit'), disabled: true, - handler: me.run_editor + handler: function() { me.run_editor(); } }); var revert_btn = new Proxmox.button.Button({