VintaSoft Imaging .NET SDK 14.0: Documentation for Web developer
Vintasoft.Imaging.UI Namespace / WebThumbnailViewerJS type / set_ContextMenuFunc Property
Syntax Exceptions Remarks Example BrowserCompatibility SeeAlso
In This Topic
    set_ContextMenuFunc Method
    In This Topic
    Sets a function that should be executed when "contextmenu" event occurs in the viewer.
    Syntax
    var instance = new Vintasoft.Imaging.UI.WebThumbnailViewerJS(controlId);
    
    var returnValue; // Type: any
    
    // Parameters
    var value; // Type: function
    
    returnValue = instance.set_ContextMenuFunc(value);
    
    
    function set_ContextMenuFunc(
    value
    A function OR null that equals to "function(event){ return false; }".
    : Function
    ) : any;

    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 function
    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