Bug 1335905 - Fixed Hidden Code for seach bar r?jaws, r?mconley draft
authormanotejmeka <manotejmeka@gmail.com>
Fri, 24 Feb 2017 15:09:21 -0500
changeset 489878 e396ecc3f6cbf78ce53e728a16dc64956563e654
parent 489342 115ee5430863cbb21fc30ab4cee921d797966de2
child 489879 9597671d951d1656ec31363cf1ae2b33c413408d
child 490307 ed234b9a97291ba604c14e0cc1f5abead3fe1a2f
child 490633 67e327092aca41ef57e9f682219742a3d571a869
push id46931
push userbmo:manotejmeka@gmail.com
push dateMon, 27 Feb 2017 01:50:22 +0000
reviewersjaws, mconley
bugs1335905
milestone54.0a1
Bug 1335905 - Fixed Hidden Code for seach bar r?jaws, r?mconley MozReview-Commit-ID: F8lrLyCA2JT
browser/components/preferences/in-content/SearchEach.js
browser/components/preferences/in-content/preferences.xul
--- 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