Bug 622578 - Remove the filter functionality [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Tue, 15 Feb 2011 11:36:26 +0100
changeset 67392 e2d9f1ccb1483f0f0de1acb95e33eea60b2be334
parent 67391 ec2b8e10fc44c6aa4e88400f4a2cb3bf366baceb
child 67393 43a92edbbe1c2d7241cd41392409dca3d9f05e68
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs622578
Bug 622578 - Remove the filter functionality [r=mfinkle]
mobile/chrome/content/SelectHelperUI.js
mobile/chrome/content/browser.xul
mobile/locales/en-US/chrome/browser.dtd
mobile/themes/core/browser.css
--- a/mobile/chrome/content/SelectHelperUI.js
+++ b/mobile/chrome/content/SelectHelperUI.js
@@ -6,24 +6,17 @@ var SelectHelperUI = {
   _list: null,
   _selectedIndexes: null,
 
   get _panel() {
     delete this._panel;
     return this._panel = document.getElementById("select-container");
   },
 
-  get _textbox() {
-    delete this._textbox;
-    return this._textbox = document.getElementById("select-helper-textbox");
-  },
-
   show: function selectHelperShow(aList) {
-    this.showFilter = false;
-    this._textbox.blur();
     this._list = aList;
 
     this._container = document.getElementById("select-list");
     this._container.setAttribute("multiple", aList.multiple ? "true" : "false");
 
     this._selectedIndexes = this._getSelectedIndexes();
     let firstSelected = null;
 
@@ -64,27 +57,16 @@ var SelectHelperUI = {
       BrowserUI.pushPopup(this, this._panel);
 
     this._scrollElementIntoView(firstSelected);
 
     this._container.addEventListener("click", this, false);
     this._panel.addEventListener("overflow", this, true);
   },
 
-  _showFilter: false,
-  get showFilter() {
-    return this._showFilter;
-  },
-
-  set showFilter(val) {
-    this._showFilter = val;
-    if (!this._panel.hidden)
-      this._textbox.hidden = !val;
-  },
-
   dock: function selectHelperDock(aContainer) {
     aContainer.insertBefore(this._panel, aContainer.lastChild);
     this.resize();
     this._docked = true;
   },
 
   undock: function selectHelperUndock() {
     let rootNode = Elements.stack;
@@ -96,51 +78,39 @@ var SelectHelperUI = {
   reset: function selectHelperReset() {
     this._updateControl();
     let empty = this._container.cloneNode(false);
     this._container.parentNode.replaceChild(empty, this._container);
     this._container = empty;
     this._list = null;
     this._selectedIndexes = null;
     this._panel.height = "";
-    this._textbox.value = "";
   },
 
   resize: function selectHelperResize() {
     this._panel.style.maxHeight = (window.innerHeight / 1.8) + "px";
   },
 
   hide: function selectHelperResize() {
     if (!this._list)
       return;
 
-    this.showFilter = false;
     this._container.removeEventListener("click", this, false);
     this._panel.removeEventListener("overflow", this, true);
 
     this._panel.hidden = true;
 
     if (this._docked)
       this.undock();
     else
       BrowserUI.popPopup(this);
 
     this.reset();
   },
 
-  filter: function selectHelperFilter(aValue) {
-    let reg = new RegExp(aValue, "gi");
-    let options = this._container.childNodes;
-    for (let i = 0; i < options.length; i++) {
-      let option = options[i];
-      option.getAttribute("label").match(reg) ? option.removeAttribute("filtered")
-                                              : option.setAttribute("filtered", "true");
-    }
-  },
-
   unselectAll: function selectHelperUnselectAll() {
     if (!this._list)
       return;
 
     let choices = this._list.choices;
     this._forEachOption(function(aItem, aIndex) {
       aItem.selected = false;
       choices[aIndex].selected = false;
@@ -247,20 +217,16 @@ var SelectHelperUI = {
             this.unselectAll();
 
             // Select the new one and update the control
             item.selected = true;
           }
           this.onSelect(item.optionIndex, item.selected, !this._list.multiple);
         }
         break;
-      case "overflow":
-        if (!this._textbox.value)
-          this.showFilter = true;
-        break;
     }
   },
 
   onSelect: function selectHelperOnSelect(aIndex, aSelected, aClearAll) {
     let json = {
       index: aIndex,
       selected: aSelected,
       clearAll: aClearAll
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -276,18 +276,16 @@
             </vbox>
           </vbox>
         </scrollbox>
 
         <!-- popup for content navigator helper -->
         <vbox id="content-navigator" class="window-width" top="0" spacer="content-navigator-spacer">
           <arrowscrollbox id="form-helper-autofill" collapsed="true" align="center" flex="1" orient="horizontal"
                           onclick="FormHelperUI.doAutoComplete(event.target);"/>
-          <textbox id="select-helper-textbox" class="search-bar content-navigator-item" oncommand="SelectHelperUI.filter(this.value)"
-                   placeholder="&selectHelper.emptytext;" type="search" flex="1" hidden="true"/>
           <textbox id="find-helper-textbox" class="search-bar content-navigator-item" oncommand="FindHelperUI.search(this.value)" oninput="FindHelperUI.updateCommands(this.value);" type="search" flex="1"/>
         </vbox>
 
         <!-- horizontal scrollbar -->
         <box id="horizontal-scroller" class="scroller" orient="horizontal" left="0" bottom="2"/>
       </stack>
 
       <!-- Right toolbar -->
--- a/mobile/locales/en-US/chrome/browser.dtd
+++ b/mobile/locales/en-US/chrome/browser.dtd
@@ -105,11 +105,9 @@
 
 <!ENTITY pageactions.saveas.pdf      "Save As PDF">
 <!ENTITY pageactions.share.page      "Share Page">
 <!ENTITY pageactions.password.forget "Forget Password">
 <!ENTITY pageactions.reset           "Clear Site Preferences">
 <!ENTITY pageactions.findInPage      "Find In Page">
 <!ENTITY pageactions.search.addNew   "Add Search Engine">
 
-<!ENTITY selectHelper.emptytext      "Filter List">
-
 <!ENTITY appMenu.siteOptions         "Site Options">
--- a/mobile/themes/core/browser.css
+++ b/mobile/themes/core/browser.css
@@ -1328,17 +1328,16 @@ pageaction:not([image]) > hbox >.pageact
   display: -moz-box;
 }
 
 #content-navigator:not([type="form"]) > #form-helper-autofill {
   visibility: collapse;
 }
 
 #content-navigator:not([type="form"]) > #select-container,
-#content-navigator:not([type="form"]) > #select-helper-textbox,
 #content-navigator:not([type="find"]) > #find-helper-textbox {
   display: none;
 }
 
 #content-navigator > #select-container > #select-container-inner {
   border-width: 0;
   border-radius: @border_radius_normal@ @border_radius_normal@ 0 0;
   padding: @padding_normal@ @padding_small@ @padding_normal@ @padding_small@;
@@ -1393,17 +1392,16 @@ pageaction:not([image]) > hbox >.pageact
   background-color: #3d3f42;
 }
 
 #content-navigator > hbox > toolbarbutton[disabled="true"] {
   opacity: 0.5;
 }
 
 #form-helper-autofill,
-#select-helper-textbox,
 #find-helper-textbox {
   border: none;
   margin: @margin_small@;
   border-radius: @border_radius_normal@;
 }
 
 #form-helper-autofill {
   padding: 0; /* half core spacing & none (autorepeat arrows compensate) */
@@ -1481,19 +1479,16 @@ pageaction:not([image]) > hbox >.pageact
   background-color: #fff;
   padding: @padding_small@;
   border-bottom: @border_width_tiny@ solid rgb(207,207,207);
   min-height: @touch_row@; /* row size */
   max-height: @touch_row@; /* row size */
   -moz-box-align: center;
 }
 
-.chrome-select-option[filtered="true"] {
-  display: none;
-}
 
 .chrome-select-option[selected="true"] {
   background-color: #8db8d8;
 }
 
 .chrome-select-option[disabled="true"] {
   pointer-events: none;
   color: #aaa !important;