I have a svg element on top of the viewer canvas created with snap.svg, so I can draw nametags for elements on this svg layer. After I create the svg layer the viewer reacts to left clicks normally, but doesn't open the context menu anymore. How to open the context menu programmatically? I can catch the click event with jQuery and get the x and y location.
$("#svg-canvas").contextmenu(function (e) {
console.log('x: ' + e.screenX + ' y: ' + e.screenY);
});
I tried also changing the z-index of .menu and the svg layer, but if the svg layer is on top and shows the svg elements, it does not open the context menu with right click.
I looked at the Viewer 2.11 source code and this seems to work.