81a04805893ab59c954464ac449abe65da05ac7f hiram Mon Sep 21 16:28:30 2026 -0700 highlight NCBI "reference" assemblies in the search result and hg.conf gated with hgGateway.showRefBadge=on default is off refs #38401 diff --git src/hg/js/autocompleteCat.js src/hg/js/autocompleteCat.js index 0f0e7ce13d5..7df8909c63a 100644 --- src/hg/js/autocompleteCat.js +++ src/hg/js/autocompleteCat.js @@ -36,36 +36,50 @@ currentCategory = item.category; } that._renderItem( ul, item ); }); ul.append("
Unable to find a genome? Send us a request
"); }, _renderItem: function(ul, item) { // In order to use HTML markup in the autocomplete, one has to overwrite // autocomplete's _renderItem method using .html instead of .text. // http://forum.jquery.com/topic/using-html-in-autocomplete let clockIcon = ''; let posInput = $("#positionInput"); if (posInput.length > 0 && posInput.val() && posInput.val().length < 2) { clockIcon = ' '; } + // NCBI RefSeq "reference" assemblies get a green 'reference' word badge. + let refBadge = ''; + if (item.isReference) { + refBadge = 'reference '; + } // Hits to assembly hub top level (not individial db names) have no item label, // so use the value instead - return $("
  • ") + var $a = $("").html(clockIcon + refBadge + (item.label !== null ? item.label : item.value)); + var $li = $("
  • ") .data("ui-autocomplete-item", item) - .append($("").html(clockIcon + (item.label !== null ? item.label : item.value))) + .append($a) .appendTo(ul); + if (item.isReference && typeof addMouseover === "function") { + // Apply the site's positioned tooltip (utils.js) to the whole row, not just + // the badge glyph, and use it instead of the native title popup, which can + // render below the icon and get hidden under a large custom cursor -- same + // fix used for hgTracks image mouseovers. + addMouseover($a[0], "NCBI RefSeq reference assembly"); + } + return $li; } }); function toggleSpinner(add, options) { if (options.baseUrl.startsWith("hgGateway")) { // change the species select loading image if (add) $("#speciesSearch").after(""); else $("#speciesSpinner").remove(); } else if (options.baseUrl.startsWith("hgSuggest")) { // change the position input loading spinner if (add) $("#positionInput").after(""); else