VintaSoft Imaging .NET SDK 15.1: Documentation for Web developer
Vintasoft.Imaging.UI Namespace / WebImageViewerJS type / set_ContextMenuFunc Property
Syntax Exceptions Remarks Example BrowserCompatibility SeeAlso
In This Topic
set_ContextMenuFunc Method
In This Topic
Sets a handler for "contextmenu" event of the viewer.
Syntax
var instance = new Vintasoft.Imaging.UI.WebImageViewerJS(controlId);

var returnValue; // Type: any

// Parameters
var value; // Type: function

returnValue = instance.set_ContextMenuFunc(value);

Parameters

value
A function OR null that equals to "function(event){ return false; }".
Exceptions
ExceptionDescription
Thrown if argument has wrong type.
Remarks

The default handler of "contextmenu" event only disables the browser context menu.
Important: Handler for "contextmenu" event will NOT be called if "get_VisualTool" property returns NOT nothing and visual tool get_DisableContextMenu property returns True.
Important: Use this property if you need to change the handler of "contexmenu" - subscribing to the viewer container "contextmenu" will not have an effect.

Example

 // define functions
 function __contextMenuFunc(event){
   console.log("Event: ", event);
   // show browser context menu
   return true;
 }

 // set function
 imageViewer1.set_ContextMenuFunc(__contextMenuFunc);

Browser Compatibility
56+
45+
11
See Also