[pve-devel] [PATCH manager] fix right click selection in tree

Dominik Csapak d.csapak at proxmox.com
Fri May 27 10:27:15 CEST 2016


in my commit 2e1eb55afc743d6c8fd186cb227d1667fbedb585
i introduced a bug with that an item gets selected
in the tree when you right click on it

also fix the function parameters

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/Utils.js             | 4 +++-
 www/manager6/tree/ResourceTree.js | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 992ae85..6900897 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -1188,7 +1188,9 @@ Ext.define('PVE.Utils', { statics: {
 
     createCmdMenu: function(v, record, item, index, event) {
 	event.stopEvent();
-	v.select(record);
+	if (!(v instanceof Ext.tree.View)) {
+	    v.select(record);
+	}
 	var menu;
 
 	if (record.data.type === 'qemu' && !record.data.template) {
diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js
index b15ed4f..5244b7c 100644
--- a/www/manager6/tree/ResourceTree.js
+++ b/www/manager6/tree/ResourceTree.js
@@ -379,9 +379,9 @@ Ext.define('PVE.tree.ResourceTree', {
 		destroy: function() {
 		    rstore.un("load", updateTree);
 		},
-		beforecellmousedown: function (tree, record,item,index,ev) {
+		beforecellmousedown: function (tree, td, cellIndex, record, tr, rowIndex, ev) {
 		    // disable selection when right clicking
-		    me.allowSelection = (event.button !== 2);
+		    me.allowSelection = (ev.button !== 2);
 		},
 		beforeselect: function (tree, record, index, eopts) {
 		    var allow = me.allowSelection;
-- 
2.1.4





More information about the pve-devel mailing list