59fe82a7fcfef11d15cecee88ff2e3b7d20d78d8 chmalee Wed Jul 26 09:02:26 2023 -0700 Fix hgSearch overwriting highlights because I was using the wrong variable to add new highlights to cart, refs #31758 diff --git src/hg/js/hgSearch.js src/hg/js/hgSearch.js index 0cc5d47..b31b736 100644 --- src/hg/js/hgSearch.js +++ src/hg/js/hgSearch.js @@ -479,31 +479,31 @@ if (["all_mrna", "all_est", "xenoMrna", "xenoEst", "intronEst"].includes(title)) { hgTracksTitle = title.replace(/all_/, ""); if (searchDesc.includes("Unaligned")) goToHgTracks = false; } if (goToHgTracks) { url = "hgTracks?db=" + db + "&" + hgTracksTitle + "=pack&position=" + match.position; if (match.hgFindMatches) { url += "&hgFind.matches=" + match.hgFindMatches; } if (match.extraSel) { url += "&" + match.extraSel; } if (match.highlight) { url += url[url.length-1] !== '&' ? '&' : ''; - url += "highlight=" + match.highlight; + url += "addHighlight=" + match.highlight; } } else { url = "hgc?db=" + db + "&g=" + hgcTitle + "&i=" + match.position + "&c=0&o=0&l=0&r=0" ; } matchTitle = match.posName; //if (match.canonical === true) matchTitle = "" + matchTitle + ""; } var newListObj; if (printCount < 500) { if (printCount + 1 > 10) { newListObj = "
  • " + matchTitle + " - "; } @@ -798,31 +798,31 @@ if (typeof cartJson !== "undefined") { if (cartJson.db !== undefined) { db = cartJson.db; } else { alert("Error no database from request"); } // check right away for a special redirect to hgTracks: if (cartJson.positionMatches !== undefined && cartJson.positionMatches.length == 1 && cartJson.positionMatches[0].matches[0].doRedirect === true) { positionMatch = cartJson.positionMatches[0]; match = positionMatch.matches[0]; position = match.position; newUrl = "../cgi-bin/hgTracks" + "?db=" + db + "&position=" + position; if (match.highlight) { - newUrl += "&highlight=" + match.highlight; + newUrl += "&addHighlight=" + match.highlight; } if (positionMatch.name !== "chromInfo") { newUrl += "&" + positionMatch.name + "=pack"; } window.location.replace(newUrl); } var urlParts = {}; if (debugCartJson) { console.log('from server:\n', cartJson); } if (typeof cartJson.search !== "undefined") { urlParts = changeUrl({"search": cartJson.search}); } else { urlParts = changeUrl({"db": db}); cartJson.search = urlParts.urlVars.search;