bug 1396836 - Tidy up about:telemetry search r=Dexter

Search would leave text in the input field when switching categories,
show a 'No search results' message on load, and show a 'No search results'
message in sections without search inputs.

Tidy those cases away.

MozReview-Commit-ID: BbkgIjq8fYD

--HG--
extra : rebase_source : 3d1b02d6c29096c42cdcce795689214b44b8cf00
This commit is contained in:
Chris H-C 2017-09-08 15:13:59 -04:00
Родитель 7c7699bdeb
Коммит 86379d4ddd
2 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -1375,6 +1375,9 @@ var Search = {
let sectionId = document.querySelector(".category.selected").getAttribute("value");
section = document.getElementById(sectionId);
}
if (Search.blacklist.includes(section.id)) {
return;
}
let noSearchResults = true;
if (section.id === "home-section") {
return this.homeSearch(text);
@ -1869,6 +1872,7 @@ function refreshSearch() {
function adjustSearchState() {
let selectedSection = document.querySelector(".category.selected").getAttribute("value");
let search = document.getElementById("search");
search.value = "";
search.hidden = Search.blacklist.includes(selectedSection);
document.getElementById("no-search-results").classList.add("hidden");
Search.search(""); // reinitialize search state.

Просмотреть файл

@ -138,7 +138,7 @@
<input type="text" id="search" placeholder=""/>
</div>
<div id="no-search-results" hidden="true">
<div id="no-search-results" hidden="true" class="hidden">
<span id="no-search-results-text"></span>
<div class="no-search-results-image"></div>
</div>