13945005698c2779fe67a58decf79b3121efbab9 galt Fri Dec 12 17:38:15 2014 -0800 Fixes 14509. hgTracks.js had an incorrect assumption that the position to be updated in the document title would always be in the 2nd position after parsing on spaces. But "D. melanogaster" and several others which used the scientific name would break. It was tricky because it could get fixed by certain refreshes. The new hgTracks.js needs to get pushed with this release. The fix involves simply scanning for a word that contains a colon character which should only appear in the position field, and does not appear in dbDb names or sci-names. diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 978e58a..8377efa 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -3557,31 +3557,35 @@ // replaceState on initial page load, pushState on each advance // When call triggered by back button, the lastPos===newPos, so no action. var lastPos = imageV2.history.getState().data.position; var newPos = encodeURIComponent(genomePos.get().replace(/,/g,'')); // no commas // A full page load could be triggered by back-button, but then there will be a lastPos // if this is the case then don't set the position in history again! if (fullPageLoad && lastPos) return; if (!lastPos || lastPos !== newPos) { // Swap the position into the title var title = $('TITLE')[0].text; var ttlWords = title.split(' '); if (ttlWords.length >= 2) { - ttlWords[1] = genomePos.get(); + for (var i=1; i < ttlWords.length; i++) { + if (ttlWords[i].indexOf(':') >= 0) { + ttlWords[i] = genomePos.get(); + } + } title = ttlWords.join(' '); } else title = genomePos.get(); var sid = getHgsid(); // Wish you were here! Come on, someone must catch this. if (fullPageLoad) { // Should only be on initial set-up: first navigation to page imageV2.history.replaceState({position: newPos, hgsid: + sid },title, "hgTracks?db=" + getDb() + "&position=" + newPos + "&hgsid="+sid); } else { // Should be when advancing (not-back-button) imageV2.history.pushState({position: newPos, hgsid: + getHgsid()},title, "hgTracks?db=" + getDb() + "&position=" + newPos + "&hgsid="+sid); } }