d64d6f53f31908c3570247a94023297d44ce3ee4 hiram Thu Sep 5 14:47:32 2024 -0700 add prompt text to input box and correctly do not place + in front of - refs #32596 diff --git src/hg/js/assemblySearch.js src/hg/js/assemblySearch.js index 5cb6ac9..16595a5 100644 --- src/hg/js/assemblySearch.js +++ src/hg/js/assemblySearch.js @@ -700,31 +700,33 @@ disableButtons(); var wordMatch = document.querySelector('input[name="wordMatch"]:checked').value; var asmStatus = document.querySelector('input[name="asmStatus"]:checked').value; var refSeqCategory = document.querySelector('input[name="refSeqCategory"]:checked').value; var asmLevel = document.querySelector('input[name="asmLevel"]:checked').value; // start with what the user requested: var queryString = query; // for allWords, place + sign in front of each word if not already there if (wordMatch === "allWords") { var words = queryString.split(/\s+/); if (words.length > 1) { // not needed on only one word var queryPlus = ""; // compose new query string words.forEach(function(word) { - if (word.startsWith("+")) { + if (word.startsWith("-")) { + queryPlus += " " + word; // do not add + to - + } else if (word.startsWith("+")) { queryPlus += " " + word; // space separates each word } else { queryPlus += " +" + word; } }); queryString = queryPlus.trim(); } } // remove stray white space from beginning or end queryString = queryString.trim(); // Show the wait spinner document.querySelector(".submitContainer").classList.add("loading"); document.getElementById("loadingSpinner").style.display = "block";