I can assign a context menu to a specific part of a node by simply setting the contextMenu
option, but I don’t see an option (for go.HTMLInfo
) to set the default event to left click instead of right click.
Displaying the context menu when clicking anywhere on the node is easy though
myDiagram.addDiagramListener("ObjectSingleClicked", function(e) {
var part = e.subject.part;
if (!(part instanceof go.Link)) {
myDiagram.toolManager.contextMenuTool.showContextMenu(myContextMenu, part);
}
});
But how can I detect which shape from inside the part the click event originated from?