From f69bdb4a7fd71b2a56fe0d108b4b48917302730d Mon Sep 17 00:00:00 2001 From: "kairo%kairo.at" Date: Sat, 5 May 2007 04:37:29 +0000 Subject: [PATCH] bug 142215 - Personal Toolbar folders should work like main menu (open on mouseover), p=paradigmk@technodrome.com r=Neil --- suite/common/bookmarks/bookmarksMenu.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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 ()