From 8ee06348c72d32b01f4dea26fa159f2b5480d4f2 Mon Sep 17 00:00:00 2001 From: Donovan Buck Date: Sun, 19 Aug 2012 19:29:01 -0500 Subject: [PATCH] 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 ) --- src/jquery.contextMenu.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/jquery.contextMenu.js b/src/jquery.contextMenu.js index 2b4da541..5098b541 100755 --- a/src/jquery.contextMenu.js +++ b/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');