]> git.proxmox.com Git - pve-manager.git/commitdiff
disable selecting when right clicking in tree
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 28 Apr 2016 13:24:00 +0000 (15:24 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 29 Apr 2016 07:14:09 +0000 (09:14 +0200)
ext4 would not select a tree item on right click,
ext6 does this, so we have to save which
mousebutton was clicked and react accordingly

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/tree/ResourceTree.js

index 202a46f9299ed23f020ea60d6ad1293aae6fd980..a71f4627bfc80d3fe349c65c66ca4b3cf40c67f3 100644 (file)
@@ -357,6 +357,7 @@ Ext.define('PVE.tree.ResourceTree', {
        sp.on('statechange', statechange);
 
        Ext.apply(me, {
+           allowSelection: true,
            store: store,
            viewConfig: {
                // note: animate cause problems with applyState
@@ -398,7 +399,16 @@ Ext.define('PVE.tree.ResourceTree', {
                },
                destroy: function() {
                    rstore.un("load", updateTree);
-               }
+               },
+               beforecellmousedown: function (tree, record,item,index,ev) {
+                   // disable selection when right clicking
+                   me.allowSelection = !(event.button === 2);
+               },
+               beforeselect: function (tree, record, index, eopts) {
+                   var allow = me.allowSelection;
+                   me.allowSelection = true;
+                   return allow;
+               },
            },
            setViewFilter: function(view) {
                me.viewFilter = view;