Skip to content

Commit 3f5d061

Browse files
committed
prevent builtin menu
1 parent 8156091 commit 3f5d061

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jquery.contextmenu.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
options: {
2020
delegate: "[data-menu]", // selector
2121
menu: null, // selector or jQuery or a function returning such
22+
preventBuiltinMenu: true,
2223
// Events:
2324
beforeopen: $.noop, // menu about to open; return `false` to prevent opening
2425
blur: $.noop, // menu option lost focus
@@ -30,8 +31,12 @@
3031
select: $.noop // menu option was selected; return `false` to prevent closing
3132
},
3233
_create: function () {
33-
var self = this;
3434
this.element.delegate(this.options.delegate, "click", $.proxy(this._openMenu, this));
35+
if(this.options.preventBuiltinMenu){
36+
this.element.delegate(this.options.delegate, "contextmenu.contextmenu", function(event){
37+
return false;
38+
});
39+
}
3540
this._trigger("init");
3641
},
3742
/** Return menu jQuery object. */

0 commit comments

Comments
 (0)