Permalink
Browse files

Changed to use jQuery object that is passed in

We should use the jQuery object that has been passed into contextMenu's IIFE in case the global jQuery name has been freed by jQuery.noConflict( true )
  • Loading branch information...
1 parent a25b3a7 commit 8ee06348c72d32b01f4dea26fa159f2b5480d4f2 @dtex dtex committed Aug 20, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/jquery.contextMenu.js
View
8 src/jquery.contextMenu.js
@@ -252,7 +252,7 @@ var // currently active contextMenu trigger
click: function(e) {
e.preventDefault();
e.stopImmediatePropagation();
- $(this).trigger(jQuery.Event("contextmenu", { data: e.data, pageX: e.pageX, pageY: e.pageY }));
+ $(this).trigger($.Event("contextmenu", { data: e.data, pageX: e.pageX, pageY: e.pageY }));
},
// contextMenu right-click trigger
mousedown: function(e) {
@@ -277,7 +277,7 @@ var // currently active contextMenu trigger
e.preventDefault();
e.stopImmediatePropagation();
$currentTrigger = $this;
- $this.trigger(jQuery.Event("contextmenu", { data: e.data, pageX: e.pageX, pageY: e.pageY }));
+ $this.trigger($.Event("contextmenu", { data: e.data, pageX: e.pageX, pageY: e.pageY }));
}
$this.removeData('contextMenuActive');
@@ -306,7 +306,7 @@ var // currently active contextMenu trigger
hoveract.timer = null;
$document.off('mousemove.contextMenuShow');
$currentTrigger = $this;
- $this.trigger(jQuery.Event("contextmenu", { data: hoveract.data, pageX: hoveract.pageX, pageY: hoveract.pageY }));
+ $this.trigger($.Event("contextmenu", { data: hoveract.data, pageX: hoveract.pageX, pageY: hoveract.pageY }));
}, e.data.delay );
},
// contextMenu hover trigger
@@ -1176,7 +1176,7 @@ $.fn.contextMenu = function(operation) {
if (operation === undefined) {
this.first().trigger('contextmenu');
} else if (operation.x && operation.y) {
- this.first().trigger(jQuery.Event("contextmenu", {pageX: operation.x, pageY: operation.y}));
+ this.first().trigger($.Event("contextmenu", {pageX: operation.x, pageY: operation.y}));
} else if (operation === "hide") {
var $menu = this.data('contextMenu').$menu;
$menu && $menu.trigger('contextmenu:hide');

0 comments on commit 8ee0634

Please sign in to comment.