Bug 1402849 - Close library panel on mid mouse click r?mikedeboer draft
authorAndrea Casaccia <acasaccia@fastmail.com>
Tue, 31 Oct 2017 09:16:50 +0200
changeset 689176 e56afc2c1949f7db8be5c50b5f28100a1787f7d0
parent 689081 083a9c84fbd09a6ff9bfecabbf773650842fe1c0
child 738255 14455bb484ae655460e54b1ed4cc4c3bddfae3f5
push id86952
push userbmo:acasaccia@fastmail.com
push dateTue, 31 Oct 2017 07:29:28 +0000
reviewersmikedeboer
bugs1402849
milestone58.0a1
Bug 1402849 - Close library panel on mid mouse click r?mikedeboer MozReview-Commit-ID: 8AM0efs7krS
browser/components/customizableui/content/panelUI.js
--- a/browser/components/customizableui/content/panelUI.js
+++ b/browser/components/customizableui/content/panelUI.js
@@ -575,16 +575,20 @@ const PanelUI = {
    *
    * @param {MouseEvent} event Click event, originating from the Highlight.
    */
   onLibraryHighlightClick(event) {
     let button = event.target;
     if (event.button > 1 || !button._highlight) {
       return;
     }
+    if (event.button == 1) {
+      // Bug 1402849, close library panel on mid mouse click
+      CustomizableUI.hidePanelForNode(button);
+    }
     window.openUILink(button._highlight.url, event);
   },
 
   /**
    * NB: The enable- and disableSingleSubviewPanelAnimations methods only
    * affect the hiding/showing animations of single-subview panels (tempPanel
    * in the showSubView method).
    */