diff --git a/suite/common/bookmarks/bookmarksMenu.js b/suite/common/bookmarks/bookmarksMenu.js index be14939321c..e1129964450 100644 --- a/suite/common/bookmarks/bookmarksMenu.js +++ b/suite/common/bookmarks/bookmarksMenu.js @@ -724,6 +724,31 @@ var BookmarksMenuDNDObserver = { var BookmarksToolbar = { + ///////////////////////////////////////////////////////////////////////////// + // make bookmarks toolbar act like menus + openMenuButton: null, + autoOpenMenu: function (aTarget) + { + if (this.openMenuButton && + this.openMenuButton != aTarget && + aTarget.localName == "toolbarbutton" && + (aTarget.type == "menu" || + aTarget.type == "menu-button")) { + this.openMenuButton.open = false; + aTarget.open = true; + } + }, + onMenuOpen: function (aTarget) + { + if (aTarget.parentNode.localName == "toolbarbutton") + this.openMenuButton = aTarget.parentNode; + }, + onMenuClose: function (aTarget) + { + if (aTarget.parentNode.localName == "toolbarbutton") + this.openMenuButton = null; + }, + ///////////////////////////////////////////////////////////////////////////// // returns the node of the last visible bookmark on the toolbar --> getLastVisibleBookmark: function ()