jQuery-contextMenu
jQuery-contextMenu copied to clipboard
Make the modal layer let click events passthrough
This adds the useModal option, defaults to true for the existing behaviour.
With useModal set to false, rather than creating a hidden layer behind the contextmenu to capture closing clicks, uses document.addeventlistener in capture mode.
This allows for propagating click events when clicking in empty space to close the contextmenu (before, only the mousedown event was propagated, and no click was sent since the following mouseup would not be on the same element)
Note useModal = false might break on older browsers, or some features might not work with it anymore (unlikely though).