We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c824a51 + 68a0650 commit 0f72e8dCopy full SHA for 0f72e8d
src/jquery.contextMenu.js
@@ -1228,7 +1228,7 @@ $.fn.contextMenu = function(operation) {
1228
} else if (operation.x && operation.y) {
1229
this.first().trigger($.Event("contextmenu", {pageX: operation.x, pageY: operation.y}));
1230
} else if (operation === "hide") {
1231
- var $menu = this.data('contextMenu').$menu;
+ var $menu = this.first().data('contextMenu') ? this.first().data('contextMenu').$menu : null;
1232
$menu && $menu.trigger('contextmenu:hide');
1233
} else if (operation === "destroy") {
1234
$.contextMenu("destroy", {context: this});
0 commit comments