fix right click selection in tree

in my commit 685b7aa4c5
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@proxmox.com>
This commit is contained in:
Dominik Csapak 2016-05-27 10:27:15 +02:00 committed by Dietmar Maurer
parent 897e77907c
commit cc1a91be71
3 changed files with 7 additions and 3 deletions

View File

@ -2,6 +2,8 @@ pve-manager (4.2-8) unstable; urgency=medium
* depend on pve-docs package
* fix right click selection in tree
-- Proxmox Support Team <support@proxmox.com> Wed, 25 May 2016 10:00:22 +0200
pve-manager (4.2-7) unstable; urgency=medium

View File

@ -1188,7 +1188,9 @@ Ext.define('PVE.Utils', { statics: {
createCmdMenu: function(v, record, item, index, event) {
event.stopEvent();
if (!(v instanceof Ext.tree.View)) {
v.select(record);
}
var menu;
if (record.data.type === 'qemu' && !record.data.template) {

View File

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