Bug 784879 - use collapsed instead of hidden for status panels. r=gavin.
authorShane Caraveo
Thu, 23 Aug 2012 11:23:17 -0700
changeset 105407 aa807b020b71559cc39bc0ca23bb4b75529c27c6
parent 105406 42c88798cb2c858dbc77beb4af5f5e804c96b72d
child 105408 5734825a4f1f1c74017261c6d7afacfa2de5094f
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersgavin
bugs784879
milestone17.0a1
Bug 784879 - use collapsed instead of hidden for status panels. r=gavin.
browser/base/content/browser-social.js
--- a/browser/base/content/browser-social.js
+++ b/browser/base/content/browser-social.js
@@ -331,16 +331,18 @@ var SocialToolbar = {
   },
 
   updateButton: function SocialToolbar_updateButton() {
     this.updateButtonHiddenState();
     let provider = Social.provider;
     let iconNames = Object.keys(provider.ambientNotificationIcons);
     let iconBox = document.getElementById("social-status-iconbox");
     let notifBox = document.getElementById("social-notification-box");
+    let panel = document.getElementById("social-notification-panel");
+    panel.hidden = false;
     let notificationFrames = document.createDocumentFragment();
     let iconContainers = document.createDocumentFragment();
 
     for each(let name in iconNames) {
       let icon = provider.ambientNotificationIcons[name];
 
       let notificationFrameId = "social-status-" + icon.name;
       let notificationFrame = document.getElementById(notificationFrameId);
@@ -390,18 +392,16 @@ var SocialToolbar = {
   },
 
   showAmbientPopup: function SocialToolbar_showAmbientPopup(iconContainer) {
     let iconImage = iconContainer.firstChild;
     let panel = document.getElementById("social-notification-panel");
     let notifBox = document.getElementById("social-notification-box");
     let notificationFrame = document.getElementById(iconImage.getAttribute("notificationFrameId"));
 
-    panel.hidden = false;
-
     function sizePanelToContent() {
       // FIXME: bug 764787: Maybe we can use nsIDOMWindowUtils.getRootBounds() here?
       // Need to handle dynamic sizing
       let doc = notificationFrame.contentDocument;
       if (!doc) {
         return;
       }
       // "notif" is an implementation detail that we should get rid of
@@ -410,17 +410,17 @@ var SocialToolbar = {
       if (!body || !body.firstChild) {
         return;
       }
 
       // Clear dimensions on all browsers so the panel size will
       // only use the selected browser.
       let frameIter = notifBox.firstElementChild;
       while (frameIter) {
-        frameIter.hidden = (frameIter != notificationFrame);
+        frameIter.collapsed = (frameIter != notificationFrame);
         frameIter = frameIter.nextElementSibling;
       }
 
       let [height, width] = [body.firstChild.offsetHeight || 300, 330];
       notificationFrame.style.width = width + "px";
       notificationFrame.style.height = height + "px";
     }