diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 132927f023be..fc3a1d6f1470 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -2495,7 +2495,7 @@ function toDownloadManager() dlmgrWindow.focus(); } else { - dlmgr.open(window, null); + window.openDialog("chrome://browser/content/downloadmanager/downloadmanager.xul", "Downloads", "chrome"); } } @@ -3197,3 +3197,43 @@ nsBrowserContentListener.prototype = parentContentListener: null } +function openSidebar(aElt) { + var sidebar = document.getElementById("sidebar"); + var sidebarSplitter = document.getElementById("sidebar-splitter"); + + if (aElt.checked) { + aElt.checked = false; + sidebar.hidden = true; + sidebarSplitter.hidden = true; + return; + } + + aElt.checked = true; + + if (sidebar.hidden) { + // Can't use .hidden = false here, since that will remove the attr. + // and we need it to exist so we can persist its value. + sidebar.setAttribute("hidden", "false"); + sidebarSplitter.setAttribute("hidden", "false"); + } + var url = aElt.getAttribute("sidebarurl"); + sidebar.setAttribute("src", url); +} + +function goPreferences(containerID, paneURL, itemID) +{ + var pref = Components.classes["@mozilla.org/preferences-service;1"] + .getService(Components.interfaces.nsIPrefBranch); + //check for an existing pref window and focus it; it's not application modal + const kWindowMediatorContractID = "@mozilla.org/appshell/window-mediator;1"; + const kWindowMediatorIID = Components.interfaces.nsIWindowMediator; + const kWindowMediator = Components.classes[kWindowMediatorContractID].getService(kWindowMediatorIID); + var lastPrefWindow = kWindowMediator.getMostRecentWindow("mozilla:preferences"); + if (lastPrefWindow) + lastPrefWindow.focus(); + else { + var features = "chrome,titlebar,resizable"; + openDialog("chrome://browser/content/pref/pref.xul","PrefWindow", + features, paneURL, containerID, itemID); + } +} diff --git a/browser/base/content/utilityOverlay.js b/browser/base/content/utilityOverlay.js index b59ed93f1244..a5f947ba0f7e 100644 --- a/browser/base/content/utilityOverlay.js +++ b/browser/base/content/utilityOverlay.js @@ -76,36 +76,6 @@ function goPageSetup(domwin, printSettings) return true; } -function goPreferences(containerID, paneURL, itemID) -{ - var resizable; - var pref = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefBranch); - try { - // We are resizable ONLY if in box debugging mode, because in - // this special debug mode it is often impossible to see the - // content of the debug panel in order to disable debug mode. - resizable = pref.getBoolPref("xul.debug.box"); - } - catch (e) { - resizable = false; - } - - //check for an existing pref window and focus it; it's not application modal - const kWindowMediatorContractID = "@mozilla.org/appshell/window-mediator;1"; - const kWindowMediatorIID = Components.interfaces.nsIWindowMediator; - const kWindowMediator = Components.classes[kWindowMediatorContractID].getService(kWindowMediatorIID); - var lastPrefWindow = kWindowMediator.getMostRecentWindow("mozilla:preferences"); - if (lastPrefWindow) - lastPrefWindow.focus(); - else { - var resizability = resizable ? "yes" : "no"; - var features = "chrome,titlebar,resizable=" + resizability; - openDialog("chrome://browser/content/pref/pref.xul","PrefWindow", - features, paneURL, containerID, itemID); - } -} - function goToggleToolbar( id, elementID ) { var toolbar = document.getElementById( id );