Docs | Utilities | Javascript

Context

description Context Menu
type javascript
source src\dvc\js\_brayworth_.context.js

Example

$('#elementID').on( 'contextmenu', function( e) {
    if ( e.shiftKey) return;                // use the native menu if you hold shiftKey down

    e.stopPropagation();e.preventDefault(); // prevent the native browser contextmenu

    _brayworth_.hideContexts();             // hide any open contextmenus

    let _context = _brayworth_.context();

    _context.append( $('<a href="#">hello</a>'));

    _context.open( e);

});