Bug 1500860 - Reposition arrowpanel arrow to line up with toolbar button. r=mkmelin
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 22 Oct 2018 21:42:21 +1300
changeset 33437 92010c1e95c1222f1fea4a07a92b23f1cbeb9848
parent 33436 70c2176c3b1322967407ed66b46c5ae129427a1e
child 33438 5a8c03dfb2ac10a53f0c16ff87e39c8787ef0cb4
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersmkmelin
bugs1500860
Bug 1500860 - Reposition arrowpanel arrow to line up with toolbar button. r=mkmelin
mail/components/extensions/ExtensionPopups.jsm
mail/components/extensions/ExtensionToolbarButtons.jsm
--- a/mail/components/extensions/ExtensionPopups.jsm
+++ b/mail/components/extensions/ExtensionPopups.jsm
@@ -252,16 +252,18 @@ class BasePopup {
       this.lastCalculatedInViewHeight = Math.max(height, this.viewHeight);
     } else {
       this.browser.style.width = `${width}px`;
       this.browser.style.minWidth = `${width}px`;
       this.browser.style.height = `${height}px`;
       this.browser.style.minHeight = `${height}px`;
     }
 
+    this.panel.adjustArrowPosition();
+
     let event = new this.window.CustomEvent("WebExtPopupResized", {detail});
     this.browser.dispatchEvent(event);
   }
 
   setBackground(background) {
     // Panels inherit the applied theme (light, dark, etc) and there is a high
     // likelihood that most extension authors will not have tested with a dark theme.
     // If they have not set a background-color, we force it to white to ensure visibility
--- a/mail/components/extensions/ExtensionToolbarButtons.jsm
+++ b/mail/components/extensions/ExtensionToolbarButtons.jsm
@@ -181,17 +181,17 @@ this.ToolbarButtonAPI = class extends Ex
   async triggerAction(window) {
     let {document} = window;
     let button = document.getElementById(this.id);
     let popupURL = this.getProperty(this.globals, "popup");
     let enabled = this.getProperty(this.globals, "enabled");
 
     if (button && popupURL && enabled) {
       let popup = ViewPopup.for(this.extension, window) || this.getPopup(window, popupURL);
-      popup.viewNode.openPopup(button);
+      popup.viewNode.openPopup(button, "bottomcenter topleft", 0, 0);
     } else {
       this.emit("click");
     }
   }
 
   /**
    * Event listener.
    *