Right click tree to show node context menu
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

This commit is contained in:
Garrett Mills 2021-02-18 10:47:59 -06:00
parent 3474fe4cc4
commit d99503250a
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

View File

@ -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);
},
} }
} }
}; };