diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 0b621c86534..8ce5a139b04 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -4530,14 +4530,15 @@ function onViewToolbarsPopupShowing(aEvent) for (i = 0; i < gNavToolbox.childNodes.length; ++i) { var toolbar = gNavToolbox.childNodes[i]; var toolbarName = toolbar.getAttribute("toolbarname"); - var type = toolbar.getAttribute("type"); - if (toolbarName && type != "menubar") { - var menuItem = document.createElement("menuitem"); + if (toolbarName) { + let menuItem = document.createElement("menuitem"); + let hidingAttribute = toolbar.getAttribute("type") == "menubar" ? + "autohide" : "collapsed"; menuItem.setAttribute("toolbarindex", i); menuItem.setAttribute("type", "checkbox"); menuItem.setAttribute("label", toolbarName); menuItem.setAttribute("accesskey", toolbar.getAttribute("accesskey")); - menuItem.setAttribute("checked", toolbar.getAttribute("collapsed") != "true"); + menuItem.setAttribute("checked", toolbar.getAttribute(hidingAttribute) != "true"); popup.insertBefore(menuItem, firstMenuItem); menuItem.addEventListener("command", onViewToolbarCommand, false); @@ -4550,9 +4551,12 @@ function onViewToolbarCommand(aEvent) { var index = aEvent.originalTarget.getAttribute("toolbarindex"); var toolbar = gNavToolbox.childNodes[index]; + var hidingAttribute = toolbar.getAttribute("type") == "menubar" ? + "autohide" : "collapsed"; - toolbar.collapsed = aEvent.originalTarget.getAttribute("checked") != "true"; - document.persist(toolbar.id, "collapsed"); + toolbar.setAttribute(hidingAttribute, + aEvent.originalTarget.getAttribute("checked") != "true"); + document.persist(toolbar.id, hidingAttribute); } function displaySecurityInfo() diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index cd40d61f2ec..41e71f5933e 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -284,6 +284,10 @@ # The entire main menubar is placed into browser-menubar.inc, so that it can be shared by diff --git a/browser/locales/en-US/chrome/browser/browser.dtd b/browser/locales/en-US/chrome/browser/browser.dtd index 4165bb67954..1995cf28368 100644 --- a/browser/locales/en-US/chrome/browser/browser.dtd +++ b/browser/locales/en-US/chrome/browser/browser.dtd @@ -32,6 +32,8 @@ + +