We have been using a custom context menu for each node in the diagram using HTMLInfo.
Each node will have an ellipsis icon, and when user clicks (like a button click, i.e., left click) it opens a context menu on the node.
Currently we are relying on diagram’s lastInput property to determine the position to pop context menu.
But this won’t work for all nodes, as we have nodes with different size, even expandable/ collapsible nodes.
So what is the better way to popup context menu at right position. I am looking for a way to popup just below the ellipsis button, irrespective all above facts.
Below is a screen shot of how it currently looks on various nodes:
As we can see, currently it pops at different positions on each node. Below is the code that we are using to place the context menu:
// Grab the last input event on the diagram and place the context menu appropriately. ... cxElement is the context menu DOM. var mousePt = diagram.lastInput.viewPoint; cxElement.style.left = mousePt.x + 5 + "px"; cxElement.style.top = mousePt.y + "px";`
I am looking for a way to position context menu based on ellipsis icon’s position on each node. That way it would always pop at right position.
Is there a way to get that position and manipulate context menu element’s position ?