From 6a4e29a0313ed02c1623718d01d60163577fcc23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Fri, 6 Jan 2012 14:10:55 +0100 Subject: [PATCH] Backed out changeset 5fbe5ee99a27 for browser_bug321000.js failure --- browser/app/profile/firefox.js | 2 -- browser/base/content/browser.js | 35 ++++++++--------------------- browser/base/content/browser.xul | 4 +++- browser/base/content/tabbrowser.xml | 28 +++++++---------------- browser/components/nsBrowserGlue.js | 11 +-------- 5 files changed, 21 insertions(+), 59 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 83472328ec4..3e53c72931e 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -398,7 +398,6 @@ pref("browser.tabs.loadDivertedInBackground", false); pref("browser.tabs.loadBookmarksInBackground", false); pref("browser.tabs.tabClipWidth", 140); pref("browser.tabs.animate", true); -pref("browser.tabs.onTop", true); pref("browser.tabs.drawInTitlebar", true); // Where to show tab close buttons: @@ -969,7 +968,6 @@ pref("services.sync.prefs.sync.browser.tabs.closeButtons", true); pref("services.sync.prefs.sync.browser.tabs.loadInBackground", true); pref("services.sync.prefs.sync.browser.tabs.warnOnClose", true); pref("services.sync.prefs.sync.browser.tabs.warnOnOpen", true); -pref("services.sync.prefs.sync.browser.tabs.onTop", true); pref("services.sync.prefs.sync.browser.urlbar.autocomplete.enabled", true); pref("services.sync.prefs.sync.browser.urlbar.autoFill", true); pref("services.sync.prefs.sync.browser.urlbar.default.behavior", true); diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index eb93bc13a6b..44033e8a057 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1364,7 +1364,7 @@ function BrowserStartup() { allTabs.readPref(); - TabsOnTop.init(); + TabsOnTop.syncCommand(); BookmarksMenuButton.init(); @@ -5278,44 +5278,27 @@ function setToolbarVisibility(toolbar, isVisible) { } var TabsOnTop = { - init: function TabsOnTop_init() { - this.syncUI(); - Services.prefs.addObserver(this._prefName, this, false); - }, - toggle: function () { - this.enabled = !Services.prefs.getBoolPref(this._prefName); + this.enabled = !this.enabled; }, - - syncUI: function () { - let userEnabled = Services.prefs.getBoolPref(this._prefName); - let enabled = userEnabled && gBrowser.tabContainer.visible; - + syncCommand: function () { + let enabled = this.enabled; document.getElementById("cmd_ToggleTabsOnTop") - .setAttribute("checked", userEnabled); - + .setAttribute("checked", enabled); document.documentElement.setAttribute("tabsontop", enabled); - document.getElementById("navigator-toolbox").setAttribute("tabsontop", enabled); document.getElementById("TabsToolbar").setAttribute("tabsontop", enabled); gBrowser.tabContainer.setAttribute("tabsontop", enabled); TabsInTitlebar.allowedBy("tabs-on-top", enabled); }, - get enabled () { return gNavToolbox.getAttribute("tabsontop") == "true"; }, - set enabled (val) { - Services.prefs.setBoolPref(this._prefName, !!val); + gNavToolbox.setAttribute("tabsontop", !!val); + this.syncCommand(); + return val; - }, - - observe: function (subject, topic, data) { - if (topic == "nsPref:changed") - this.syncUI(); - }, - - _prefName: "browser.tabs.onTop" + } } var TabsInTitlebar = { diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index e5284b74f85..531ac3b1074 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -444,7 +444,9 @@ + iconsize="large" + tabsontop="true" + persist="tabsontop"> @@ -2838,30 +2839,17 @@ this._container.collapsed = !val; - this._propagateVisibility(); + document.getElementById("menu_closeWindow").hidden = !val; + document.getElementById("menu_close").setAttribute("label", + this.tabbrowser.mStringBundle.getString(val ? "tabs.closeTab" : "tabs.close")); + + if (window.TabsInTitlebar) + TabsInTitlebar.allowedBy("tabs-visible", val); return val; ]]> - - - -