Reputation: 506
I have a tool which when activated would need to deactivate the viewer's context menu, specifically that it does not appear on press and hold touch events.
Is there a way to deactivate and later reactivate the context menu or can I listen to the touch events and stop them from propagating to whatever launches the context menu?
Upvotes: 0
Views: 237
Reputation: 5342
The context menu instance is exposed via viewer.contextMenu
and you can call shots on it like below:
viewer.contextMenu.hide();
viewer.contextMenu.show(PointerEvent);
var contextMenu = viewer.contextmenu;
viewer.setContextMenu(null); //deactivate context menu
viewer.setContextMenu(contextMenu); //reactivate context menu
Upvotes: 1