ea158e595774ba97924827663b6d19dd4d348257
chmalee
  Tue Jun 24 12:02:22 2025 -0700
Fix bug introduced in last tooltips commit that un-disabled tooltips when right click menu is open, refs #34462

diff --git src/hg/js/jquery.contextmenu.js src/hg/js/jquery.contextmenu.js
index fc6858022df..78344c5375f 100644
--- src/hg/js/jquery.contextmenu.js
+++ src/hg/js/jquery.contextmenu.js
@@ -192,37 +192,32 @@
 					left:(x+cmenu.shadowOffsetX)+"px"
 				}).addClass(cmenu.shadowClass)[cmenu.showTransition](cmenu.showSpeed);
 			}
 		},
 		
 		// A hook to call before the menu is shown, in case special processing needs to be done.
 		// Return false to cancel the default show operation
 		beforeShow: function() { return true; },
 		
 		// Show the context menu
 		show: function(t,e) {
 			var cmenu=this, x=e.pageX, y=e.pageY;
 
             // prevent tooltips from showing up while contextmenu is open
             if (typeof showMouseovers !== 'undefined' && showMouseovers) {
-                console.log("right click open, disabling mouseovers");
-                clearTimeout(mouseoverTimer);
-                if (mousemoveController) {
-                    mousemoveController.abort();
-                }
+                suppressTooltips = true;
                 hideMouseoverText(mouseoverContainer);
-                canShowNewMouseover = false;
             }
 
 			cmenu.target = t; // Preserve the object that triggered this context menu so menu item click methods can see it
 			if (cmenu.beforeShow(e)!==false) {
 				// If the menu content is a function, call it to populate the menu each time it is displayed
 				if (cmenu.menuFunction) {
 					if (cmenu.menu) { $(cmenu.menu).remove(); }
 					cmenu.menu = cmenu.createMenu(cmenu.menuFunction(cmenu,t),cmenu);
 					cmenu.menu.css({display:'none'});
 					$(cmenu.appendTo).append(cmenu.menu);
 				}
 				var $c = cmenu.menu;
 				x+=cmenu.offsetX; y+=cmenu.offsetY;
 				var pos = cmenu.getPosition(x,y,cmenu,e); // Extracted to method for extensibility
 				cmenu.showShadow(pos.x,pos.y,e);
@@ -264,29 +259,29 @@
                         }
 			return {'x':x,'y':y};
 		},
 		
 		// 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;
             // re-enable tooltips on contextmenu close
             if (typeof showMouseovers !== 'undefined' && showMouseovers) {
-                canShowNewMouseover = true;
+                suppressTooltips = false;
             }
 		}
 	};
 	
 	// This actually adds the .contextMenu() function to the jQuery namespace
 	$.fn.contextMenu = function(menu,options) {
 		var cmenu = $.contextMenu.create(menu,options);
 		this.each(function(){
 			$(this).on('contextmenu',function(e){cmenu.show(this,e);return false;});
 		});
 		return cmenu;
 	};
 })(jQuery);