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 id21040
push userbmo@edmorley.co.uk
push dateSun, 21 Aug 2011 18:16:59 +0000
treeherdermozilla-central@482742e6fff7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs666257
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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) {