4abc3ccae28a9c56849029b9ad8c791da1efff0e
max
Mon Jan 9 04:53:29 2023 -0800
adding small text in autocommplete on hgTracks to indicate that enter or go trigger a full text search, refs #30449
diff --git src/hg/js/autocomplete.js src/hg/js/autocomplete.js
index 481be59..d8b38d7 100644
--- src/hg/js/autocomplete.js
+++ src/hg/js/autocomplete.js
@@ -85,31 +85,38 @@
});
else $(auto).css({
maxHeight: 'none',
overflow: 'hidden',
zIndex: 12
});
}
},
select: function(event, ui) {
lastSelected = ui.item.value;
suggestBox.updateFindMatches(ui.item.internalId);
selectCallback(ui.item);
// jQuery('body').css('cursor', 'wait');
// document.TrackHeaderForm.submit();
}
+ })
+ .data("autocomplete")._renderMenu = function(ul, items) {
+ var that = this;
+ jQuery.each(items, function(index, item) {
+ that._renderItem(ul, item);
});
+ ul.append("
Click the go button or press Enter to search across all tracks, hubs and our website. See 'examples' link above.
");
+ };
}
// I want to set focus to the suggest element, but unforunately that prevents PgUp/PgDn from
// working, which is a major annoyance.
// $('#positionInput').focus();
$("#positionInput").change(function(event) {
if (!lastSelected || lastSelected !== $('#positionInput').val()) {
// This handles case where user typed or edited something rather than choosing from a suggest list;
// in this case, we only change the position hidden; we do NOT update the displayed coordinates.
var val = $('#positionInput').val();
// handles case where users zeroes out positionInput; in that case we revert to currently displayed position
if (!val || val.length === 0 || val === waterMark)
val = $('#positionDisplay').text();
else
val = val.replace(/\u2013|\u2014/g, "-"); // replace en-dash and em-dash with hyphen