5eb21a72bda1cb7a5f9c293c972565caf24ffef7 kate Mon May 11 08:58:04 2020 -0700 Code cleanup for info icon. refs #23365 diff --git src/hg/lib/hui.c src/hg/lib/hui.c index cd785bd..c4482a2 100644 --- src/hg/lib/hui.c +++ src/hg/lib/hui.c @@ -8618,30 +8618,39 @@ if (sameString(subName, subGroup) && sameString(subValue, name)) { boolean newVal = FALSE; safef(option, sizeof(option),"%s_sel", subtrack->track); newVal = sameString(button, ADD_BUTTON_LABEL); cartSetBoolean(cart, option, newVal); } } } } puts("</TABLE>"); } return TRUE; } +void printInfoIcon(char *mouseover) +/* Print info icon (i) with explanatory text on mouseover + * Uses jquery icon set, with style customized to GB in jquery-ui.css */ +{ +// jquery icons print a bit high, so using sub instead of span to place next to text +printf("<sub class='ui-icon ui-icon-info' style='display: inline-block;' title='%s'></sub>", + mouseover); +} + void hCompositeUi(char *db, struct cart *cart, struct trackDb *tdb, char *primarySubtrack, char *fakeSubmit, char *formName) // UI for composite tracks: subtrack selection. If primarySubtrack is // non-NULL, don't allow it to be cleared and only offer subtracks // that have the same type. If fakeSubmit is non-NULL, add a hidden // var with that name so it looks like it was pressed. { bool hasSubgroups = (trackDbSetting(tdb, "subGroup1") != NULL); boolean isMatrix = dimensionsExist(tdb); boolean viewsOnly = FALSE; if (primarySubtrack == NULL && !cartVarExists(cart, "ajax")) { if (trackDbSetting(tdb, "dragAndDrop") != NULL) jsIncludeFile("jquery.tablednd.js", NULL); @@ -8652,45 +8661,34 @@ cgiDown(0.3); boolean hideSubtracksDefault; // TODO: Gray out or otherwise suppress when in multi-region mode if (compositeHideEmptySubtracksSetting(tdb, &hideSubtracksDefault, NULL, NULL)) { char *hideLabel = "Hide empty subtracks"; hideLabel = trackDbSettingOrDefault(tdb, SUBTRACK_HIDE_EMPTY_LABEL, hideLabel); printf("<p><b>%s:</b> ", hideLabel); char buf[128]; safef(buf, sizeof buf, "%s.%s", tdb->track, SUBTRACK_HIDE_EMPTY); boolean doHideEmpties = compositeHideEmptySubtracks(cart, tdb, NULL, NULL); cgiMakeCheckBox(buf, doHideEmpties); // info icon with explanatory text on mouseover - printf("<sub class='ui-icon ui-icon-info' style='display: inline-block;'" - " title='Subtracks with no data in the browser window" - " are hidden. Changing the browser window by zooming or scrolling may result" - " in display of a different selection of tracks.'></sub>"); -/* FA icons -puts( -"<!-- Info icon built from stacked fa icons -->\n" -" <a href='#INFO_SECTION' title='Jump to the track description'>\n" -" <span class='gbIconSmall fa-stack'>\n" -" <i class='gbBlueDarkColor fa fa-circle fa-stack-2x'></i>\n" -" <i class='gbWhiteColor fa fa-info fa-stack-1x'></i>\n" -" </span></a>\n" -); -*/ - + char *info = + "Subtracks with no data in the browser window are hidden. Changing the browser window" + " by zooming or scrolling may result in display of a different selection of tracks."; + printInfoIcon(info); printf("</p>"); } if (trackDbCountDescendantLeaves(tdb) < MANY_SUBTRACKS && !hasSubgroups) { if (primarySubtrack) compositeUiSubtracksMatchingPrimary(db, cart, tdb,primarySubtrack); else compositeUiSubtracks(db, cart, tdb); return; } if (fakeSubmit) cgiMakeHiddenVar(fakeSubmit, "submit"); if (primarySubtrack == NULL)