Right click tree to show node context menu
This commit is contained in:
parent
3474fe4cc4
commit
d99503250a
@ -80,7 +80,31 @@ export class AppComponent implements OnInit {
|
|||||||
|
|
||||||
this.menuTarget = node;
|
this.menuTarget = node;
|
||||||
this.lastClickEvent = [tree, node, $event];
|
this.lastClickEvent = [tree, node, $event];
|
||||||
|
},
|
||||||
|
contextMenu: (tree, node, event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
TREE_ACTIONS.FOCUS(tree, node, event);
|
||||||
|
TREE_ACTIONS.EXPAND(tree, node, event);
|
||||||
|
|
||||||
|
this.addChildTarget = false;
|
||||||
|
this.deleteTarget = false;
|
||||||
|
this.menuTarget = false;
|
||||||
|
|
||||||
|
if ( !node.data.noChildren && (!node.data.level || node.data.level === 'manage') ) {
|
||||||
|
this.addChildTarget = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !node.data.noDelete && (!node.data.level || node.data.level === 'manage') ) {
|
||||||
|
this.deleteTarget = node;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.menuTarget = node;
|
||||||
|
this.lastClickEvent = [tree, node, event];
|
||||||
|
|
||||||
|
this.onNodeMenuClick(event);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user