Bug 666257 - Always update dialog stack when setting activePanel (r=mbrubeck)
authorLucas Rocha <lucasr@mozilla.com>
Fri, 19 Aug 2011 09:29:22 -0700
changeset 75566 fd7bf2557b25d18d4fc6057199a7230c68c7d64c
parent 75565 241af714f92df2d108448975263213c9ae3699a0
child 75567 82b14f7ed86d736696fbe68e9a6d0ae891f59be6
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersmbrubeck
bugs666257
milestone9.0a1
Bug 666257 - Always update dialog stack when setting activePanel (r=mbrubeck) If the panel is the topmost dialog, it should be on top of the dialog stack.
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -267,42 +267,44 @@ var BrowserUI = {
 
   set activePanel(aPanel) {
     if (this._activePanel == aPanel)
       return;
 
     let awesomePanel = document.getElementById("awesome-panels");
     let awesomeHeader = document.getElementById("awesome-header");
 
+    let willHidePanel = (this._activePanel && !aPanel);
+    if (willHidePanel) {
+      awesomePanel.hidden = true;
+      awesomeHeader.hidden = false;
+      this._edit.reset();
+      this._edit.detachController();
+    }
+
+    if (this._activePanel) {
+      this.popDialog();
+      this._activePanel.close();
+    }
+
     let willShowPanel = (!this._activePanel && aPanel);
     if (willShowPanel) {
-      this.pushDialog(aPanel);
       this._edit.attachController();
       this._editURI();
       awesomePanel.hidden = awesomeHeader.hidden = false;
     };
 
     if (aPanel) {
+      this.pushDialog(aPanel);
       aPanel.open();
+
       if (this._edit.value == "")
         this._showURI();
     }
 
-    let willHidePanel = (this._activePanel && !aPanel);
-    if (willHidePanel) {
-      awesomePanel.hidden = true;
-      awesomeHeader.hidden = false;
-      this._edit.reset();
-      this._edit.detachController();
-      this.popDialog();
-    }
-
-    if (this._activePanel)
-      this._activePanel.close();
-
     // If the keyboard will cover the full screen, we do not want to show it right away.
     let isReadOnly = (aPanel != AllPagesList || this._isKeyboardFullscreen() || (!willShowPanel && this._edit.readOnly));
     this._edit.readOnly = isReadOnly;
     if (isReadOnly)
       this._edit.blur();
 
     this._activePanel = aPanel;
     if (willHidePanel || willShowPanel) {