Bug 1235873 fix pocket panel size when in menu panel, r=Gijs
authorShane Caraveo <scaraveo@mozilla.com>
Fri, 22 Jan 2016 17:39:59 -0800
changeset 281386 c1d1dfc7a40d125912cc5067af995a2117b6ce99
parent 281385 be005c69fbb61cfb10e544c0a6a0b9d5e6193a81
child 281387 197bf80d62f8f8fb123b9581a236a9cbcfd78094
push id29935
push userphilringnalda@gmail.com
push dateSun, 24 Jan 2016 02:12:02 +0000
treeherdermozilla-central@a2e81822194a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1235873
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1235873 fix pocket panel size when in menu panel, r=Gijs
browser/extensions/pocket/content/main.js
--- a/browser/extensions/pocket/content/main.js
+++ b/browser/extensions/pocket/content/main.js
@@ -303,17 +303,17 @@ var pktUI = (function() {
      */
     function resizePanel(options) {
         var iframe = getPanelFrame();
         var subview = getSubview();
 
         if (subview) {
           // Use the subview's size
           iframe.style.width = "100%";
-          iframe.style.height = subview.clientHeight + "px";
+          iframe.style.height = subview.parentNode.clientHeight + "px";
         } else {
           // Set an explicit size, panel will adapt.
           iframe.style.width  = options.width  + "px";
           iframe.style.height = options.height + "px";
         }
     }
 
     /**
@@ -530,22 +530,17 @@ var pktUI = (function() {
             frame.id = 'pocket-panel-iframe';
             frame.setAttribute("type", "content");
             frameParent.appendChild(frame);
         }
         return frame;
     }
 
     function getSubview() {
-        var frame = getPanelFrame();
-        var view = frame;
-        while (view && view.localName != "panelview") {
-            view = view.parentNode;
-        }
-
+        var view = document.getElementById("PanelUI-pocketView");
         if (view && view.getAttribute("current") == "true")
             return view;
         return null;
     }
 
     function isInOverflowMenu() {
         var subview = getSubview();
         return !!subview;