Skip to content

Commit 2d24382

Browse files
authored
Merge pull request #1 from terwarf/terwarf-patch-preShow-1
Pre-Show callback to display native menu
2 parents 16e4b14 + 331c527 commit 2d24382

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/jquery.contextMenu.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@
239239
},
240240
// events
241241
events: {
242+
preShow: $.noop,
242243
show: $.noop,
243244
hide: $.noop,
244245
activated: $.noop
@@ -278,6 +279,11 @@
278279
// contextmenu show dispatcher
279280
contextmenu: function (e) {
280281
var $this = $(this);
282+
283+
//Show browser context-menu when preShow returns false
284+
if (e.data.events.preShow($this,e) === false) {
285+
return;
286+
}
281287

282288
// disable actual context-menu if we are using the right mouse button as the trigger
283289
if (e.data.trigger === 'right') {

0 commit comments

Comments
 (0)