Bug 1420749 - Allow browser.bookmarks.openInTabClosesMenu to work with containers as well as single menuitems r=mak
authorTawny Hoover <stayopenmenu@gmail.com>
Thu, 08 Feb 2018 20:59:08 -0500
changeset 403558 f26d2eac74fba21b4b1c9f5475035148962ed18d
parent 403557 b61c885acf48ba69d2d0916e9bc0fd946114bf3c
child 403559 5d3f2a7dfdc9ee36c43fcdf04e25b49e426c908a
push id33438
push userrgurzau@mozilla.com
push dateWed, 14 Feb 2018 10:46:56 +0000
treeherdermozilla-central@c48e46d5edbf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1420749
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1420749 - Allow browser.bookmarks.openInTabClosesMenu to work with containers as well as single menuitems r=mak MozReview-Commit-ID: Bba3pLyHZUV
browser/base/content/browser-places.js
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -770,18 +770,17 @@ var BookmarksEventHandler = {
     // Handles left-click with modifier if not browser.bookmarks.openInTabClosesMenu.
     if (aEvent.button != 0 || PlacesUIUtils.openInTabClosesMenu)
       return;
     let target = aEvent.originalTarget;
     if (target.tagName != "menuitem")
       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");
     }
   },
 
   onClick: function BEH_onClick(aEvent, aView) {
     // Only handle middle-click or left-click with modifiers.
     let modifKey;
     if (AppConstants.platform == "macosx") {
@@ -791,22 +790,21 @@ var BookmarksEventHandler = {
     }
 
     if (aEvent.button == 2 || (aEvent.button == 0 && !modifKey))
       return;
 
     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") {
       // On Mac we need to extend when we remove the flag, to avoid any pre-close
       // animations.
       setTimeout(() => {
         target.removeAttribute("closemenu");
       }, 500);