5d86f984674affd2260f4555a9586c9026bf3e09 max Tue Jun 30 01:39:59 2020 -0700 moving timing messages under hgTracks image, refs #25805 diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 1af1af1..44afbba 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -3622,41 +3622,49 @@ // This will allow the backbutton to be overridden var dirty = normed($('#dirty')); if (dirty && $(dirty).val() === 'true') return true; return false; }, manyTracks: function () { // image-reload is slower than whole page reload when there are too many tracks if (!hgTracks || !hgTracks.trackDb || objKeyCount(hgTracks.trackDb) > 50) return true; return false; }, + moveTiming: function() + { // move measure timing messages to the end of the page + if ($(".timing").length > 0) { + $("body").append("<div id='timingDiv'></div>"); + $(".timing").detach().appendTo('#timingDiv'); + } + }, + updateTiming: function (response) { // update measureTiming text on current page based on what's in the response var reg = new RegExp("(<span class='timing'>.+?</span>)", "g"); var strs = []; for (var a = reg.exec(response); a && a[1]; a = reg.exec(response)) { strs.push(a[1]); } if (strs.length > 0) { $('.timing').remove(); for (var ix = strs.length; ix > 0; ix--) { - $('body').prepend(strs[ix - 1]); + $('#timingDiv').append(strs[ix - 1]); } } reg = new RegExp("(<span class='trackTiming'>[\\S\\s]+?</span>)"); a = reg.exec(response); if (a && a[1]) { $('.trackTiming').replaceWith(a[1]); } }, loadSuggestBox: function () { if ($('#positionInput').length) { if (!suggestBox.initialized) { // only call init once suggestBox.init(getDb(), $("#suggestTrack").length > 0, @@ -4465,30 +4473,32 @@ $("#tabs").css('font-family', jQuery('body').css('font-family')); $("#tabs").css('font-size', jQuery('body').css('font-size')); $('.submitOnEnter').keydown(trackSearch.searchKeydown); findTracks.normalize(); findTracks.updateMdbHelp(0); } } }; /////////////// //// READY //// /////////////// $(document).ready(function() { + imageV2.moveTiming(); + // on Safari the back button doesn't call the ready function. Reload the page if // the back button was pressed. $(window).bind("pageshow", function(event) { if (event.originalEvent.persisted) { window.location.reload() ; } }); // The page may be reached via browser history (back button) // If so, then this code should detect if the image has been changed via js/ajax // and will reload the image if necessary. // NOTE: this is needed for IE but other browsers can detect the dirty page much earlier if (!imageV2.backSupport) { if (imageV2.isDirtyPage()) { // mark as non dirty to avoid infinite loop in chrome.