Bug 1217129: Part 3 - Recalculate CustomizableUI panel arrow position after resize. r?gijs draft
authorKris Maglione <maglione.k@gmail.com>
Sun, 10 Jan 2016 23:08:37 -0800
changeset 320566 e56ecc19505725f5c556bf87856bfb7cdecdcaea
parent 320565 b577254c0f21aba616fda43a729b70e7ad65e797
child 320567 a0c403d89febb8b71846a8dd3238547290186b9d
push id9233
push usermaglione.k@gmail.com
push dateMon, 11 Jan 2016 20:43:12 +0000
reviewersgijs
bugs1217129
milestone46.0a1
Bug 1217129: Part 3 - Recalculate CustomizableUI panel arrow position after resize. r?gijs
browser/components/customizableui/content/panelUI.xml
--- a/browser/components/customizableui/content/panelUI.xml
+++ b/browser/components/customizableui/content/panelUI.xml
@@ -321,16 +321,22 @@
               this._mainView.style.removeProperty("height");
               this.showMainView();
               this._mainViewObserver.disconnect();
               break;
           }
         ]]></body>
       </method>
 
+      <method name="_shouldSetPosition">
+        <body><![CDATA[
+          return this.getAttribute("nosubviews") == "true";
+        ]]></body>
+      </method>
+
       <method name="_shouldSetHeight">
         <body><![CDATA[
           return this.getAttribute("nosubviews") != "true";
         ]]></body>
       </method>
 
       <method name="_setMaxHeight">
         <body><![CDATA[
@@ -356,20 +362,28 @@
             let newHeight = this._heightOfSubview(this._currentSubView, this._subViews);
             this._viewContainer.style.height = newHeight + "px";
           }
         ]]></body>
       </method>
       <method name="_syncContainerWithMainView">
         <body><![CDATA[
           // Check that this panel is still alive:
-          if (!this._panel || !this._panel.parentNode || !this._shouldSetHeight()) {
+          if (!this._panel || !this._panel.parentNode) {
             return;
           }
 
+          if (this._shouldSetPosition()) {
+            this._panel.adjustArrowPosition();
+          }
+
+          if (!this._shouldSetHeight()) {
+            return
+          }
+
           if (!this.ignoreMutations && !this.showingSubView && !this._transitioning) {
             let height;
             if (this.showingSubViewAsMainView) {
               height = this._heightOfSubview(this._mainView);
             } else {
               height = this._mainView.scrollHeight;
             }
             this._viewContainer.style.height = height + "px";