Bug 1335905 - Fixed Hidden Code for seach bar r?jaws, r?mconley
MozReview-Commit-ID: F8lrLyCA2JT
--- a/browser/components/preferences/in-content/SearchEach.js
+++ b/browser/components/preferences/in-content/SearchEach.js
@@ -1,15 +1,15 @@
// Search Object to load the 6th pin properly
var gSearchResults = {
init(){}
}
// Obtaining the search field
-let mainSearchElement = document.querySelectorAll("#searchTextIMF");
+let mainSearchElement = document.getElementById("searchTextIMF");
// Boolean flag to init JavaScript bindings
let firstTimeSearch = true;
document.getElementById("searchTextIMF").addEventListener("command", searchFunc);
// Obtaining the Search Results tag
const searchResultsCategory = document.getElementById("categories").firstElementChild;
@@ -17,25 +17,21 @@ const searchResultsCategory = document.g
/**
* Toggling Seachbar on and off according to browser.preference.search
*
* @returns null
*/
function hideShowSearch() {
let mainSearchEnable = Services.prefs.getBoolPref("browser.preference.search");
// Change this implementation is not put in each of the tabs. No loop
- mainSearchElement.forEach(function(node) {
-
- let vis = node.style;
- if (mainSearchEnable) {
- vis.display = "block";
- } else {
- vis.display = "none";
- }
- });
+ if (mainSearchEnable) {
+ mainSearchElement.setAttribute("hidden","false");
+ } else {
+ mainSearchElement.setAttribute("hidden","true");
+ }
}
// Clearning the search filed when before enable or disable
mainSearchElement.innerHTML = "";
mainSearchElement.value = "";
hideShowSearch();
/**
--- a/browser/components/preferences/in-content/preferences.xul
+++ b/browser/components/preferences/in-content/preferences.xul
@@ -196,17 +196,17 @@
Remove this keyset once bug 1094240 ("disablefastfind" attribute
broken in e10s mode) is fixed. -->
<key key="&focusSearch1.key;" modifiers="accel" id="focusSearch1" oncommand=";"/>
</keyset>
<vbox class="main-content" flex="1">
<div align="right">
- <textbox type="search" name="q" value="" id="searchTextIMF" placeholder="Search" oncommand=";" onclick="searchOnClick()"/>
+ <textbox type="search" name="q" value="" id="searchTextIMF" placeholder="Search" oncommand=";" hidden="true" onclick="searchOnClick()"/>
</div>
<prefpane id="mainPrefPane">
#include searchResults.xul
#include main.xul
#include search.xul
#include privacy.xul
#include containers.xul
#include advanced.xul