b31098a90350931dcb8399b7d1d8ff82c348f656
larrym
  Mon Aug 15 13:47:54 2011 -0700
return new menu rather than the container from the constructor
diff --git src/hg/js/jquery.contextmenu.js src/hg/js/jquery.contextmenu.js
index 07fbfd4..ed861f4 100644
--- src/hg/js/jquery.contextmenu.js
+++ src/hg/js/jquery.contextmenu.js
@@ -253,20 +253,21 @@
 		// Hide the menu, of course
 		hide: function() {
 			var cmenu=this;
 			if (cmenu.shown) {
 				if (cmenu.iframe) { $(cmenu.iframe).hide(); }
 				if (cmenu.menu) { cmenu.menu[cmenu.hideTransition](cmenu.hideSpeed,((cmenu.hideCallback)?function(){cmenu.hideCallback.call(cmenu);}:null)); }
 				if (cmenu.shadow) { cmenu.shadowObj[cmenu.hideTransition](cmenu.hideSpeed); }
 			}
 			cmenu.shown = false;
 		}
 	};
 	
 	// This actually adds the .contextMenu() function to the jQuery namespace
 	$.fn.contextMenu = function(menu,options) {
 		var cmenu = $.contextMenu.create(menu,options);
-		return this.each(function(){
+		this.each(function(){
 			$(this).bind('contextmenu',function(e){cmenu.show(this,e);return false;});
 		});
+		return cmenu;
 	};
 })(jQuery);