diff --git a/browser/components/places/content/places.js b/browser/components/places/content/places.js index 8f65352e529..3a302d31fac 100755 --- a/browser/components/places/content/places.js +++ b/browser/components/places/content/places.js @@ -1643,3 +1643,27 @@ var ViewMenu = { result.sortingMode = sortingMode; } }; + +var PlacesToolbar = { + // make places toolbar act like menus + openedMenuButton: null, + + autoOpenMenu: function (aTarget) { + if (this.openedMenuButton && this.openedMenuButton != aTarget && + aTarget.localName == "toolbarbutton" && + (aTarget.type == "menu" || aTarget.type == "menu-button")) { + this.openedMenuButton.open = false; + aTarget.open = true; + } + }, + + onMenuOpen: function (aTarget) { + if (aTarget.parentNode.localName == "toolbarbutton") + this.openedMenuButton = aTarget.parentNode; + }, + + onMenuClose: function (aTarget) { + if (aTarget.parentNode.localName == "toolbarbutton") + this.openedMenuButton = null; + } +}; diff --git a/browser/components/places/content/places.xul b/browser/components/places/content/places.xul index ff7d5f4492a..459c70347b2 100755 --- a/browser/components/places/content/places.xul +++ b/browser/components/places/content/places.xul @@ -141,7 +141,10 @@ - +