disable selecting when right clicking in tree

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>
This commit is contained in:
Dominik Csapak 2016-04-28 15:24:00 +02:00 committed by Dietmar Maurer
parent 7dbf5bf8d2
commit c36d5b7f79

View 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;