cb245d0c42739a9904c6239e59817e5dec052f49
max
  Wed Nov 6 07:40:02 2024 -0800
hide legend if all gnomad pli tracks are hidden, refs #26169

diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index cb092c1..97ad15d 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -9507,44 +9507,46 @@
                                   "return imageV2.navigateButtonClick(this);");
         hTextVar("dinkR", cartUsualString(cart, "dinkR", "2.0"), 3);
         hButtonWithOnClick("hgt.dinkRR", " > ", "Move end position to the right",
                                   "return imageV2.navigateButtonClick(this);");
         hPrintf("</TD>");
         hPrintf("</TR></TABLE>\n");
         }
 
     if( chromosomeColorsMade )
         {
         hPrintf("<B>Chromosome Color Key:</B><BR> ");
         hPrintf("<IMG SRC = \"../images/new_colorchrom.gif\" BORDER=1 WIDTH=596 HEIGHT=18 ><BR>\n");
         }
     if (doPliColors)
         {
+        hPrintf("<div id='gnomadColorKeyLegend'>");
         hPrintf("<B>gnomAD Loss-of-Function Constraint (LOEUF) Color Key:</B><BR> ");
         hPrintf("<table style=\"border: 1px solid black\"><tr>\n");
         hPrintf("<td style=\"background-color:rgb(244,0,2)\">&lt; 0.1</td>\n");
         hPrintf("<td style=\"background-color:rgb(240,74,3)\">&lt; 0.2</td>\n");
         hPrintf("<td style=\"background-color:rgb(233,127,5)\">&lt; 0.3</td>\n");
         hPrintf("<td style=\"background-color:rgb(224,165,8)\">&lt; 0.4</td>\n");
         hPrintf("<td style=\"background-color:rgb(210,191,13)\">&lt; 0.5</td>\n");
         hPrintf("<td style=\"background-color:rgb(191,210,22)\">&lt; 0.6</td>\n");
         hPrintf("<td style=\"background-color:rgb(165,224,26)\">&lt; 0.7</td>\n");
         hPrintf("<td style=\"background-color:rgb(127,233,58)\">&lt; 0.8</td>\n");
         hPrintf("<td style=\"background-color:rgb(74,240,94)\">&lt; 0.9</td>\n");
         hPrintf("<td style=\"background-color:rgb(0,244,153)\">&ge; 0.9</td>\n");
         hPrintf("<td style=\"color: white; background-color:rgb(160,160,160)\">No LOEUF score</td>\n");
         hPrintf("</tr></table>\n");
+        hPrintf("</div>"); // gnomadColorKeyLegend
         }
 
     if (showTrackControls)
 	{
 	/* Display viewing options for each track. */
         /* Chuck: This is going to be wrapped in a table so that
          * the controls don't wrap around randomly */
         hPrintf("<table id='trackCtrlTable' border=0 cellspacing=1 cellpadding=1>\n");
 
         // since this is all a huge table (which it shouldn't be), the only way to add whitespace between two rows is to add an empty row
         // since padding and margin are not allowed on table rows. (One day, we will remove this table)
         hPrintf("<tr style='height:5px'><td></td></tr>\n");
 
         hPrintf("<tr><td align='left'>\n");