Bug 666257 - Dismiss dialogs before panels with Escape key (r=mbrubeck)
authorLucas Rocha <lucasr@mozilla.com>
Fri, 19 Aug 2011 09:29:23 -0700
changeset 75544 82b14f7ed86d736696fbe68e9a6d0ae891f59be6
parent 75543 fd7bf2557b25d18d4fc6057199a7230c68c7d64c
child 75545 d73f45cc050613c69a084e52c75fd57c3525a681
push id1341
push usermbrubeck@mozilla.com
push dateFri, 19 Aug 2011 16:29:58 +0000
treeherdermozilla-inbound@1f7abb28b276 [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 - Dismiss dialogs before panels with Escape key (r=mbrubeck) There are cases where we show dialogs on top of panels (e.g. sync connection dialog). We want Escape key to dismiss them before the panels.
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -885,29 +885,29 @@ var BrowserUI = {
     aEvent.stopPropagation();
 
     // Check open popups
     if (this._popup) {
       this._hidePopup();
       return;
     }
 
+    // Check open dialogs
+    let dialog = this.activeDialog;
+    if (dialog && dialog != this.activePanel) {
+      dialog.close();
+      return;
+    }
+
     // Check active panel
     if (this.activePanel) {
       this.activePanel = null;
       return;
     }
 
-    // Check open dialogs
-    let dialog = this.activeDialog;
-    if (dialog) {
-      dialog.close();
-      return;
-    }
-
     // Check open modal elements
     let modalElementsLength = document.getElementsByClassName("modal-block").length;
     if (modalElementsLength > 0)
       return;
 
     // Check open panel
     if (this.isPanelVisible()) {
       this.hidePanel();