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
This commit is contained in:
Tawny Hoover 2018-02-08 20:59:08 -05:00
Родитель 41a0fa43ae
Коммит 85044e0002
1 изменённых файлов: 4 добавлений и 6 удалений

Просмотреть файл

@ -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") {