зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 5fbe5ee99a27 for browser_bug321000.js failure
This commit is contained in:
Родитель
90fdcfe3bc
Коммит
72b2745105
|
@ -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);
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -444,7 +444,9 @@
|
|||
|
||||
<toolbox id="navigator-toolbox"
|
||||
defaultmode="icons" mode="icons"
|
||||
iconsize="large">
|
||||
iconsize="large"
|
||||
tabsontop="true"
|
||||
persist="tabsontop">
|
||||
<!-- Menu -->
|
||||
<toolbar type="menubar" id="toolbar-menubar" class="chromeclass-menubar" customizable="true"
|
||||
defaultset="menubar-items"
|
||||
|
|
|
@ -2770,7 +2770,8 @@
|
|||
Services.prefs.addObserver("browser.tabs.", this._prefObserver, false);
|
||||
window.addEventListener("resize", this, false);
|
||||
|
||||
this._propagateVisibility();
|
||||
if (window.TabsInTitlebar)
|
||||
TabsInTitlebar.allowedBy("tabs-visible", this.visible);
|
||||
]]>
|
||||
</constructor>
|
||||
|
||||
|
@ -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;
|
||||
]]></setter>
|
||||
</property>
|
||||
|
||||
<method name="_propagateVisibility">
|
||||
<body><![CDATA[
|
||||
let visible = this.visible;
|
||||
|
||||
document.getElementById("menu_closeWindow").hidden = !visible;
|
||||
document.getElementById("menu_close").setAttribute("label",
|
||||
this.tabbrowser.mStringBundle.getString(visible ? "tabs.closeTab" : "tabs.close"));
|
||||
|
||||
goSetCommandEnabled("cmd_ToggleTabsOnTop", visible);
|
||||
|
||||
if (window.TabsOnTop)
|
||||
TabsOnTop.syncUI();
|
||||
|
||||
if (window.TabsInTitlebar)
|
||||
TabsInTitlebar.allowedBy("tabs-visible", visible);
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="updateVisibility">
|
||||
<body><![CDATA[
|
||||
if (this.childNodes.length - this.tabbrowser._removingTabs.length == 1)
|
||||
|
|
|
@ -1100,7 +1100,7 @@ BrowserGlue.prototype = {
|
|||
},
|
||||
|
||||
_migrateUI: function BG__migrateUI() {
|
||||
const UI_VERSION = 6;
|
||||
const UI_VERSION = 5;
|
||||
const BROWSER_DOCURL = "chrome://browser/content/browser.xul#";
|
||||
let currentUIVersion = 0;
|
||||
try {
|
||||
|
@ -1222,15 +1222,6 @@ BrowserGlue.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
if (currentUIVersion < 6) {
|
||||
// convert tabsontop attribute to pref
|
||||
let toolboxResource = this._rdf.GetResource(BROWSER_DOCURL + "navigator-toolbox");
|
||||
let tabsOnTopResource = this._rdf.GetResource("tabsontop");
|
||||
let tabsOnTopAttribute = this._getPersist(toolboxResource, tabsOnTopResource);
|
||||
if (tabsOnTopAttribute)
|
||||
Services.prefs.setBoolPref("browser.tabs.onTop", tabsOnTopAttribute == "true");
|
||||
}
|
||||
|
||||
if (this._dirty)
|
||||
this._dataSource.QueryInterface(Ci.nsIRDFRemoteDataSource).Flush();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче