diff --git a/mobile/chrome/content/browser-ui.js b/mobile/chrome/content/browser-ui.js index 90401d7e6a5..857a0567816 100644 --- a/mobile/chrome/content/browser-ui.js +++ b/mobile/chrome/content/browser-ui.js @@ -499,8 +499,8 @@ var BrowserUI = { // Give the new page lots of room Browser.hideSidebars(); + this.closeAutoComplete(true); - this._edit.popup.close(); this._edit.value = aURI; var flags = Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP; @@ -515,6 +515,13 @@ var BrowserUI = { BrowserSearch.updateSearchButtons(); this._edit.showHistoryPopup(); }, + + closeAutoComplete: function closeAutoComplete(aResetInput) { + if (aResetInput) + this._edit.popup.close(); + else + this._edit.popup.closePopup(); + }, isAutoCompleteOpen: function isAutoCompleteOpen() { return this._edit.popup.popupOpen; @@ -529,8 +536,7 @@ var BrowserUI = { // Give the new page lots of room Browser.hideSidebars(); - - this._edit.popup.closePopup(); + this.closeAutoComplete(false); // Make sure we're online before attempting to load Util.forceOnline(); @@ -553,12 +559,14 @@ var BrowserUI = { this.hidePanel(); if (aURI == "about:blank") { + // Display awesomebar UI this.showToolbar(true); this.showAutoComplete(); } else { // Give the new page lots of room Browser.hideSidebars(); + this.closeAutoComplete(true); } return tab;