From 5786a1bc307cf012a118ea4d74f748048bdf8292 Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Sat, 17 Mar 2012 17:45:28 +0000 Subject: [PATCH] Patch for jquery.contextmenu.js. Add jquery.contextmenu.js to Closure compiler step in Makefile git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2060 eee81c28-f429-11dd-99c0-75d572ba1ddd --- Makefile | 4 ++++ editor/contextmenu/jquery.contextMenu.js | 4 ++-- editor/svg-editor.html | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2a8948fd..52b55c68 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,9 @@ CLOSURE=build/tools/closure-compiler.jar ZIP=zip # All files that will be compiled by the Closure compiler. + JS_FILES=\ + contextmenu/jquery.contextmenu.js \ browser.js \ svgtransformlist.js \ math.js \ @@ -55,6 +57,8 @@ $(COMPILED_JS): $(CLOSURE_JS_ARGS) \ --js_output_file $(COMPILED_JS) +compile: $(COMPILED_JS) + release: build/$(PACKAGE) cd build ; $(ZIP) $(PACKAGE).zip -r $(PACKAGE) ; cd .. tar -z -c -f build/$(PACKAGE)-src.tar.gz \ diff --git a/editor/contextmenu/jquery.contextMenu.js b/editor/contextmenu/jquery.contextMenu.js index 3892cc3b..86bb8f8f 100755 --- a/editor/contextmenu/jquery.contextMenu.js +++ b/editor/contextmenu/jquery.contextMenu.js @@ -38,12 +38,12 @@ if(jQuery)( function() { menu.addClass('contextMenu'); // Simulate a true right click - $(this).mousedown( function(e) { + $(this).bind( "contextmenu mousedown", function(e) { var evt = e; $(this).mouseup( function(e) { var srcElement = $(this); srcElement.unbind('mouseup'); - if( evt.button === 2 || o.allowLeft) { + if( evt.button === 2 || o.allowLeft || evt.type === "contextmenu" ) { e.stopPropagation(); // Hide context menus that may be showing $(".contextMenu").hide(); diff --git a/editor/svg-editor.html b/editor/svg-editor.html index 5cad70c7..8dce445a 100644 --- a/editor/svg-editor.html +++ b/editor/svg-editor.html @@ -21,11 +21,11 @@ - +