From 121adc29a7e9dd6a1becdee5964afa66ea824359 Mon Sep 17 00:00:00 2001 From: Mark Finkle Date: Fri, 19 Jun 2009 01:14:04 -0400 Subject: [PATCH] Bug 498572: Cursor does not stay in the URLBar after making a new tab, r=stuart --- mobile/chrome/content/browser-ui.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mobile/chrome/content/browser-ui.js b/mobile/chrome/content/browser-ui.js index e30fbbeafc56..ce73575b0cc1 100644 --- a/mobile/chrome/content/browser-ui.js +++ b/mobile/chrome/content/browser-ui.js @@ -275,16 +275,19 @@ var BrowserUI = { }, update : function(aState) { - var icons = document.getElementById("urlbar-icons"); + let icons = document.getElementById("urlbar-icons"); + let uri = Browser.selectedBrowser.currentURI; switch (aState) { case TOOLBARSTATE_LOADED: icons.setAttribute("mode", "view"); - this.showToolbar(); + if (uri.spec == "about:blank") + this.showToolbar(URLBAR_EDIT); + else + this.showToolbar(); - if (!this._faviconLink) { - this._faviconLink = Browser.selectedBrowser.currentURI.prePath + "/favicon.ico"; - } + if (!this._faviconLink) + this._faviconLink = uri.prePath + "/favicon.ico"; this._setIcon(this._faviconLink); this.updateIcon(); this._faviconLink = null; @@ -293,6 +296,7 @@ var BrowserUI = { case TOOLBARSTATE_LOADING: icons.setAttribute("mode", "loading"); this.showToolbar(URLBAR_FORCE); + this._favicon.src = ""; this._faviconLink = null; this.updateIcon(); @@ -433,9 +437,8 @@ var BrowserUI = { }, newTab : function newTab() { + this.hideTabs(); Browser.addTab("about:blank", true); - ws.panTo(0, -this.toolbarH); - this.showToolbar(URLBAR_EDIT); }, closeTab : function closeTab(aTab) {