Bug 1371236 - don't try to open the overflow panel when in customize mode, r?jaws draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 22 Jun 2017 14:12:24 +0100
changeset 599981 2230a937b5522dd30757018e0a0d682b15f0a05b
parent 598150 2b07ef4f3381eafab2183a46704bed50800bede3
child 634895 7805ec6584786f44d89306c977672b64c5da1df8
push id65652
push userbmo:gijskruitbosch+bugs@gmail.com
push dateFri, 23 Jun 2017 21:43:24 +0000
reviewersjaws
bugs1371236
milestone56.0a1
Bug 1371236 - don't try to open the overflow panel when in customize mode, r?jaws MozReview-Commit-ID: H2mOlOkUNLG
browser/components/customizableui/CustomizableUI.jsm
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -4136,17 +4136,19 @@ OverflowableToolbar.prototype = {
         } else {
           this._panel.hidePopup();
         }
         break;
       case "customizationstarting":
         this._disable();
         break;
       case "dragover":
-        this._showWithTimeout();
+        if (this._enabled) {
+          this._showWithTimeout();
+        }
         break;
       case "dragend":
         this._panel.hidePopup();
         break;
       case "popuphiding":
         this._onPanelHiding(aEvent);
         break;
       case "resize":
@@ -4173,20 +4175,19 @@ OverflowableToolbar.prototype = {
       gELS.addSystemEventListener(contextMenu, "command", this, true);
       let anchor = doc.getAnonymousElementByAttribute(this._chevron, "class", "toolbarbutton-icon");
       // Ensure we update the gEditUIVisible flag when opening the popup, in
       // case the edit controls are in it.
       this._panel.addEventListener("popupshowing", () => doc.defaultView.updateEditUIVisibility(), {once: true});
       this._panel.openPopup(anchor || this._chevron);
       this._chevron.open = true;
 
-      let overflowableToolbarInstance = this;
-      this._panel.addEventListener("popupshown", function(aEvent) {
-        this.addEventListener("dragover", overflowableToolbarInstance);
-        this.addEventListener("dragend", overflowableToolbarInstance);
+      this._panel.addEventListener("popupshown", aEvent => {
+        this._panel.addEventListener("dragover", this);
+        this._panel.addEventListener("dragend", this);
         resolve();
       }, {once: true});
     });
   },
 
   _onClickChevron(aEvent) {
     if (this._chevron.open) {
       this._panel.hidePopup();