diff --git a/mobile/chrome/content/browser-ui.js b/mobile/chrome/content/browser-ui.js index a7b28420374..0ad3abb60a8 100644 --- a/mobile/chrome/content/browser-ui.js +++ b/mobile/chrome/content/browser-ui.js @@ -677,6 +677,13 @@ var BrowserUI = { handleEscape: function (aEvent) { aEvent.stopPropagation(); + // Check open popups + if (this._popup) { + this._hidePopup(); + return; + } + + // Check active panel if (BrowserUI.activePanel) { BrowserUI.activePanel = null; return; @@ -689,12 +696,6 @@ var BrowserUI = { return; } - // Check open popups - if (this._popup) { - this._hidePopup(); - return; - } - // Check open modal elements let modalElementsLength = document.getElementsByClassName("modal-block").length; if (modalElementsLength > 0) diff --git a/mobile/chrome/content/browser.js b/mobile/chrome/content/browser.js index 702577c7d52..18d0d034de5 100644 --- a/mobile/chrome/content/browser.js +++ b/mobile/chrome/content/browser.js @@ -1926,6 +1926,13 @@ IdentityHandler.prototype = { }, toggle: function ih_toggle() { + // When the urlbar is active the identity button is used to show the + // list of search engines + if (Elements.urlbarState.getAttribute("mode") == "edit") { + CommandUpdater.doCommand("cmd_opensearch"); + return; + } + if (this._identityPopup.hidden) this.show(); else @@ -1938,13 +1945,6 @@ IdentityHandler.prototype = { handleIdentityButtonEvent: function(aEvent) { aEvent.stopPropagation(); - // When the urlbar is active the identity button is used to show the - // list of search engines - if (Elements.urlbarState.getAttribute("mode") == "edit") { - CommandUpdater.doCommand("cmd_opensearch"); - return; - } - if ((aEvent.type == "click" && aEvent.button != 0) || (aEvent.type == "keypress" && aEvent.charCode != KeyEvent.DOM_VK_SPACE && aEvent.keyCode != KeyEvent.DOM_VK_RETURN))