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 281238 c1d1dfc7a40d125912cc5067af995a2117b6ce99
parent 281237 be005c69fbb61cfb10e544c0a6a0b9d5e6193a81
child 281239 197bf80d62f8f8fb123b9581a236a9cbcfd78094
push id17181
push usermixedpuppy@gmail.com
push dateSat, 23 Jan 2016 01:40:23 +0000
treeherderfx-team@c1d1dfc7a40d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1235873
milestone46.0a1
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;