Bug 1377967 - make middle clicking history, bookmarks and closed tabs items work correctly, r=mikedeboer

MozReview-Commit-ID: VQUuQHyCXi

--HG--
extra : rebase_source : 75e148a49ed86e1c979991daa43d31cfbf9511e0
This commit is contained in:
Gijs Kruitbosch 2017-08-09 21:04:27 +01:00
parent 12b877d713
commit e105c93b98
2 changed files with 11 additions and 1 deletions

View File

@ -2020,7 +2020,7 @@ this.PlacesPanelview = class extends PlacesViewBase {
get events() {
if (this._events)
return this._events;
return this._events = ["command", "dragend", "dragstart", "ViewHiding", "ViewShown"];
return this._events = ["click", "command", "dragend", "dragstart", "ViewHiding", "ViewShown"];
}
get panel() {
@ -2033,6 +2033,11 @@ this.PlacesPanelview = class extends PlacesViewBase {
handleEvent(event) {
switch (event.type) {
case "click":
// For left and middle clicks, fall through to the command handler.
if (event.button >= 2) {
break;
}
case "command":
this._onCommand(event);
break;
@ -2060,6 +2065,7 @@ this.PlacesPanelview = class extends PlacesViewBase {
return;
PlacesUIUtils.openNodeWithEvent(button._placesNode, event);
this.panelMultiView.closest("panel").hidePopup();
}
_onDragEnd() {

View File

@ -110,6 +110,10 @@ this.RecentlyClosedTabsAndWindowsMenuUtils = {
aEvent.view.undoCloseTab(aEvent.originalTarget.getAttribute("value"));
aEvent.view.gBrowser.moveTabToEnd();
let ancestorPanel = aEvent.target.closest("panel");
if (ancestorPanel) {
ancestorPanel.hidePopup();
}
},
};