From 7ada155800790916d02fbc4d9c24bcc10ae8466a Mon Sep 17 00:00:00 2001 From: "chanial%noos.fr" Date: Sat, 20 Mar 2004 08:13:39 +0000 Subject: [PATCH] Bug 234717, 234116, Context menu commands don't work in *subfolders* of bookmarks menu. Remove the last two children instead of using getElementsByAttributes. The latter is no more needed, since now, insertion of bookmarks with DND occurs at the correct location. YAW--. --- .../bookmarks/content/bookmarksMenu.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/browser/components/bookmarks/content/bookmarksMenu.js b/browser/components/bookmarks/content/bookmarksMenu.js index f8039208e9a5..78c66525b3b2 100644 --- a/browser/components/bookmarks/content/bookmarksMenu.js +++ b/browser/components/bookmarks/content/bookmarksMenu.js @@ -83,17 +83,11 @@ var BookmarksMenu = { // hides the 'Open in Tabs' on popuphidden so that we won't duplicate it --> hideOpenInTabsMenuItem: function (aTarget) { -# sometimes insertions occur between the "open in tabs" menuitem and -# menuseparator. the eventual children of the menupopup have should -# have already been closed at this stage, so it''s ok to grab the first -# "open in tabs" menuitem and menuseparator. - var nodeList; - nodeList = aTarget.getElementsByAttribute("class", "openintabs-menuitem"); - if (nodeList.length > 0) - aTarget.removeChild(nodeList[0]); - nodeList = aTarget.getElementsByAttribute("class", "openintabs-menuseparator"); - if (nodeList.length > 0) - aTarget.removeChild(nodeList[0]); + if (aTarget.hasChildNodes() && + aTarget.lastChild.getAttribute("class") == "openintabs-menuitem") { + aTarget.removeChild(aTarget.lastChild); + aTarget.removeChild(aTarget.lastChild); + } }, #endif