mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-28 18:17:29 +09:00
[Pale-Moon] Revert "Issue #1936 - Optionally leave Bookmarks menu open when spawning new tab."
This reverts commit 72d882780643d2f11717525e342febe866b18880.
This commit is contained in:
parent
6461b0708d
commit
7121fc7844
5 changed files with 14 additions and 57 deletions
|
|
@ -494,9 +494,6 @@ pref("browser.bookmarks.autoExportHTML", false);
|
||||||
// 0: no backups created (and deletes all existing backups)
|
// 0: no backups created (and deletes all existing backups)
|
||||||
pref("browser.bookmarks.max_backups", 10);
|
pref("browser.bookmarks.max_backups", 10);
|
||||||
|
|
||||||
// Whether menu should close after Ctrl-click, middle-click, etc.
|
|
||||||
pref("browser.bookmarks.openInTabClosesMenu", true);
|
|
||||||
|
|
||||||
// Scripts & Windows prefs
|
// Scripts & Windows prefs
|
||||||
pref("dom.disable_open_during_load", true);
|
pref("dom.disable_open_during_load", true);
|
||||||
pref("javascript.options.showInConsole", true);
|
pref("javascript.options.showInConsole", true);
|
||||||
|
|
|
||||||
|
|
@ -371,7 +371,6 @@
|
||||||
placespopup="true"
|
placespopup="true"
|
||||||
context="placesContext"
|
context="placesContext"
|
||||||
openInTabs="children"
|
openInTabs="children"
|
||||||
onmouseup="BookmarksEventHandler.onMouseUp(event);"
|
|
||||||
oncommand="BookmarksEventHandler.onCommand(event, this.parentNode._placesView);"
|
oncommand="BookmarksEventHandler.onCommand(event, this.parentNode._placesView);"
|
||||||
onclick="BookmarksEventHandler.onClick(event, this.parentNode._placesView);"
|
onclick="BookmarksEventHandler.onClick(event, this.parentNode._placesView);"
|
||||||
onpopupshowing="PlacesCommandHook.updateBookmarkAllTabsCommand();
|
onpopupshowing="PlacesCommandHook.updateBookmarkAllTabsCommand();
|
||||||
|
|
|
||||||
|
|
@ -767,46 +767,17 @@ HistoryMenu.prototype = {
|
||||||
* Functions for handling events in the Bookmarks Toolbar and menu.
|
* Functions for handling events in the Bookmarks Toolbar and menu.
|
||||||
*/
|
*/
|
||||||
var BookmarksEventHandler = {
|
var BookmarksEventHandler = {
|
||||||
|
|
||||||
/**
|
|
||||||
* Handler for mouseUp event for an item in the bookmarks toolbar or menu.
|
|
||||||
* When items are middle-clicked (or clicked with modifier), check if the
|
|
||||||
* menu should remain open.
|
|
||||||
* @param aEvent
|
|
||||||
* DOMEvent for the click
|
|
||||||
*/
|
|
||||||
|
|
||||||
onMouseUp(aEvent) {
|
|
||||||
// Handles left-click with modifier if not browser.bookmarks.openInTabClosesMenu.
|
|
||||||
if (aEvent.button != 0 ||
|
|
||||||
Services.prefs.getBoolPref("browser.bookmarks.openInTabClosesMenu", true))
|
|
||||||
return;
|
|
||||||
let target = aEvent.originalTarget;
|
|
||||||
if (target.tagName != "menuitem")
|
|
||||||
return;
|
|
||||||
#ifdef XP_MACOSX
|
|
||||||
var modifKey = aEvent.metaKey;
|
|
||||||
#else
|
|
||||||
var modifKey = aEvent.ctrlKey;
|
|
||||||
#endif
|
|
||||||
// Don't keep menu open for 'Open all in Tabs'.
|
|
||||||
if (modifKey && !target.classList.contains("openintabs-menuitem")) {
|
|
||||||
target.setAttribute("closemenu", "none");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler for click event for an item in the bookmarks toolbar or menu.
|
* Handler for click event for an item in the bookmarks toolbar or menu.
|
||||||
* Menus and submenus from the folder buttons bubble up to this handler.
|
* Menus and submenus from the folder buttons bubble up to this handler.
|
||||||
* Left-click is handled in the onCommand function.
|
* Left-click is handled in the onCommand function.
|
||||||
* When items are middle-clicked (or clicked with modifier), open in tabs.
|
* When items are middle-clicked (or clicked with modifier), open in tabs.
|
||||||
* If the click came through a menu, close the menu unless preffed otherwise.
|
* If the click came through a menu, close the menu.
|
||||||
* @param aEvent
|
* @param aEvent
|
||||||
* DOMEvent for the click
|
* DOMEvent for the click
|
||||||
* @param aView
|
* @param aView
|
||||||
* The places view which aEvent should be associated with.
|
* The places view which aEvent should be associated with.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
onClick: function(aEvent, aView) {
|
onClick: function(aEvent, aView) {
|
||||||
// Only handle middle-click or left-click with modifiers.
|
// Only handle middle-click or left-click with modifiers.
|
||||||
var modifKey = aEvent.ctrlKey || aEvent.shiftKey;
|
var modifKey = aEvent.ctrlKey || aEvent.shiftKey;
|
||||||
|
|
@ -815,23 +786,19 @@ var BookmarksEventHandler = {
|
||||||
}
|
}
|
||||||
|
|
||||||
var target = aEvent.originalTarget;
|
var target = aEvent.originalTarget;
|
||||||
// If this event bubbled up from a menu or menuitem,
|
// If this event bubbled up from a menu or menuitem, close the menus.
|
||||||
// close the menus if browser.bookmarks.openInTabClosesMenu.
|
// Do this before opening tabs, to avoid hiding the open tabs confirm-dialog.
|
||||||
if ((Services.prefs.getBoolPref("browser.bookmarks.openInTabClosesMenu", true) &&
|
if (target.localName == "menu" || target.localName == "menuitem") {
|
||||||
target.tagName == "menuitem") ||
|
for (node = target.parentNode; node; node = node.parentNode) {
|
||||||
target.tagName == "menu" ||
|
if (node.localName == "menupopup") {
|
||||||
target.classList.contains("openintabs-menuitem")) {
|
node.hidePopup();
|
||||||
closeMenus(aEvent.target);
|
} else if (node.localName != "menu" &&
|
||||||
}
|
node.localName != "splitmenu" &&
|
||||||
// Command already precesssed so remove any closemenu attr set in onMouseUp.
|
node.localName != "hbox" &&
|
||||||
if (aEvent.button == 0 &&
|
node.localName != "vbox" ) {
|
||||||
target.tagName == "menuitem" &&
|
break;
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target._placesNode && PlacesUtils.nodeIsContainer(target._placesNode)) {
|
if (target._placesNode && PlacesUtils.nodeIsContainer(target._placesNode)) {
|
||||||
|
|
|
||||||
|
|
@ -548,7 +548,6 @@
|
||||||
placespopup="true"
|
placespopup="true"
|
||||||
context="placesContext"
|
context="placesContext"
|
||||||
openInTabs="children"
|
openInTabs="children"
|
||||||
onmouseup="BookmarksEventHandler.onMouseUp(event);"
|
|
||||||
oncommand="BookmarksEventHandler.onCommand(event, this.parentNode._placesView);"
|
oncommand="BookmarksEventHandler.onCommand(event, this.parentNode._placesView);"
|
||||||
onclick="event.stopPropagation();
|
onclick="event.stopPropagation();
|
||||||
BookmarksEventHandler.onClick(event, this.parentNode._placesView);"
|
BookmarksEventHandler.onClick(event, this.parentNode._placesView);"
|
||||||
|
|
@ -705,7 +704,6 @@
|
||||||
<hbox flex="1"
|
<hbox flex="1"
|
||||||
id="PlacesToolbar"
|
id="PlacesToolbar"
|
||||||
context="placesContext"
|
context="placesContext"
|
||||||
onmouseup="BookmarksEventHandler.onMouseUp(event);"
|
|
||||||
onclick="BookmarksEventHandler.onClick(event, this._placesView);"
|
onclick="BookmarksEventHandler.onClick(event, this._placesView);"
|
||||||
oncommand="BookmarksEventHandler.onCommand(event, this._placesView);"
|
oncommand="BookmarksEventHandler.onCommand(event, this._placesView);"
|
||||||
tooltip="bhTooltip"
|
tooltip="bhTooltip"
|
||||||
|
|
|
||||||
|
|
@ -100,10 +100,6 @@
|
||||||
|
|
||||||
<menupopup id="placesContext"
|
<menupopup id="placesContext"
|
||||||
onpopupshowing="this._view = PlacesUIUtils.getViewForNode(document.popupNode);
|
onpopupshowing="this._view = PlacesUIUtils.getViewForNode(document.popupNode);
|
||||||
if (!PlacesUIUtils.openInTabClosesMenu) {
|
|
||||||
document.getElementById ('placesContext_open:newtab')
|
|
||||||
.setAttribute('closemenu', 'single');
|
|
||||||
}
|
|
||||||
return this._view.buildContextMenu(this);"
|
return this._view.buildContextMenu(this);"
|
||||||
onpopuphiding="this._view.destroyContextMenu();">
|
onpopuphiding="this._view.destroyContextMenu();">
|
||||||
<menuitem id="placesContext_open"
|
<menuitem id="placesContext_open"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue