From 85044e000224d4c809af5dca487312a5d29ff82a Mon Sep 17 00:00:00 2001 From: Tawny Hoover Date: Thu, 8 Feb 2018 20:59:08 -0500 Subject: [PATCH] Bug 1420749 - Allow browser.bookmarks.openInTabClosesMenu to work with containers as well as single menuitems r=mak MozReview-Commit-ID: Bba3pLyHZUV --HG-- extra : rebase_source : 9b82b3452277b2230783329c1f68edde2d967848 --- browser/base/content/browser-places.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js index cabfc4405448..2c51a45847e0 100644 --- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -775,8 +775,7 @@ var BookmarksEventHandler = { return; let modifKey = AppConstants.platform === "macosx" ? aEvent.metaKey : aEvent.ctrlKey; - // Don't keep menu open for 'Open all in Tabs'. - if (modifKey && !target.classList.contains("openintabs-menuitem")) { + if (modifKey) { target.setAttribute("closemenu", "none"); } }, @@ -796,12 +795,11 @@ var BookmarksEventHandler = { var target = aEvent.originalTarget; // If this event bubbled up from a menu or menuitem, // close the menus if browser.bookmarks.openInTabClosesMenu. - if ((PlacesUIUtils.openInTabClosesMenu && target.tagName == "menuitem") || - target.tagName == "menu" || - target.classList.contains("openintabs-menuitem")) { + var tag = target.tagName; + if (PlacesUIUtils.openInTabClosesMenu && (tag == "menuitem" || tag == "menu")) { closeMenus(aEvent.target); } - // Command already precesssed so remove any closemenu attr set in onMouseUp. + // Command already processed so remove any closemenu attr set in onMouseUp. if (aEvent.button == 0 && target.tagName == "menuitem" && target.getAttribute("closemenu") == "none") {