Bug 640216 - Hide navigation arrows of the form assistant if there is previous/next are both disabled [r=mfinkle,a=approval2.0+]
authorVivien Nicolas <21@vingtetun.org>
Wed, 09 Mar 2011 20:58:07 +0100
changeset 67491 40edaceac7fcdf6771eb515aa010ff9d97f373df
parent 67490 eae1b835c59f9ab32a8c02cf9497372bccd09137
child 67492 028e9ed2b0f15e3340f9b3d8d92ca98a35801e49
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, approval2
bugs640216
Bug 640216 - Hide navigation arrows of the form assistant if there is previous/next are both disabled [r=mfinkle,a=approval2.0+]
mobile/chrome/content/common-ui.js
mobile/themes/core/forms.css
--- a/mobile/chrome/content/common-ui.js
+++ b/mobile/chrome/content/common-ui.js
@@ -631,16 +631,23 @@ var FormHelperUI = {
   _currentBrowser: null,
   show: function formHelperShow(aElement, aHasPrevious, aHasNext) {
     this._currentBrowser = Browser.selectedBrowser;
     this._currentCaretRect = null;
 
     // Update the next/previous commands
     this._cmdPrevious.setAttribute("disabled", !aHasPrevious);
     this._cmdNext.setAttribute("disabled", !aHasNext);
+
+    // If both next and previous are disabled don't bother showing arrows
+    if (!aHasNext && !aHasPrevious)
+      this._container.setAttribute("disabled", "true");
+    else
+      this._container.removeAttribute("disabled");
+
     this._hasSuggestions = false;
     this._open = true;
 
     let lastElement = this._currentElement || null;
     this._currentElement = {
       id: aElement.id,
       name: aElement.name,
       title: aElement.title,
@@ -836,16 +843,18 @@ var FormHelperUI = {
     if (aVal) {
       this._zoomStart();
       this._container.show(this);
     } else {
       this._zoomFinish();
       this._currentElement = null;
       this._container.hide(this);
 
+      this._container.removeAttribute("disabled");
+
       // Since the style is overrided when a popup is shown, it needs to be
       // resetted here to let the default CSS works
       this._container.style.display = "";
     }
 
     let evt = document.createEvent("UIEvents");
     evt.initUIEvent("FormUI", true, true, window, aVal);
     this._container.dispatchEvent(evt);
--- a/mobile/themes/core/forms.css
+++ b/mobile/themes/core/forms.css
@@ -42,17 +42,17 @@
 #content-navigator {
   display: none;
   pointer-events: none;
   padding: 0;
   background-color: transparent !important;
 }
 
 #content-navigator[type="find"],
-#content-navigator[type="form"] {
+#content-navigator[type="form"]:not([disabled="true"]) {
   display: -moz-box;
 }
 
 #content-navigator > .previous-button,
 #content-navigator > .next-button {
   border: @border_width_tiny@ solid rgba(0,0,0,0.2) !important;
   border-bottom: @border_width_large@ solid #53565a !important;
   background-color: #5e6166;
@@ -215,24 +215,23 @@
 #menulist-commands {
   display: -moz-box;
 }
 
 /* Common style for Select & Menulist -------------------------------------- */
 .options-title {
   padding: @padding_xxnormal@ @padding_small@ @padding_small@ @padding_small@;
   font-size: @font_small@;
-  text-align: center;
 }
 
 .options-title[value=""] {
   display: none;
 }
 
-.option-command > image {
+.option-command image {
   width: 30px;
   height: 30px;
   margin: @margin_tiny@;
 }
 
 .option-command.selected {
   list-style-image: url("chrome://browser/skin/images/check-30.png");
 }