Bug 802784 - Possible to have two social panels open at once. r=mixedpuppy, a=gavin
authorJared Wein <jwein@mozilla.com>
Sun, 21 Oct 2012 17:28:37 -0700
changeset 116481 d8c14f8f384e69d14616166ccd061347cc17f5ec
parent 116480 5d1bc358a7819c00ae5ea00bbf8ad1018d673ac8
child 116482 042dcadba87aa3e4d3e8fece58ab2f95f076e8a4
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy, gavin
bugs802784
milestone18.0a2
Bug 802784 - Possible to have two social panels open at once. r=mixedpuppy, a=gavin
browser/base/content/browser-social.js
--- a/browser/base/content/browser-social.js
+++ b/browser/base/content/browser-social.js
@@ -367,16 +367,19 @@ let SocialFlyout = {
   onHidden: function(aEvent) {
     this._dynamicResizer.stop();
     this._dynamicResizer = null;
     this.panel.firstChild.docShell.isActive = false;
     this.dispatchPanelEvent("socialFrameHide");
   },
 
   open: function(aURL, yOffset, aCallback) {
+    // Hide any other social panels that may be open.
+    document.getElementById("social-notification-panel").hidePopup();
+
     if (!Social.provider)
       return;
     let panel = this.panel;
     if (!panel.firstChild)
       this._createFrame();
     panel.hidden = false;
     let iframe = panel.firstChild;
 
@@ -832,16 +835,19 @@ var SocialToolbar = {
                       .addProgressListener(new SocialErrorListener("notification-panel"),
                                            Ci.nsIWebProgress.NOTIFY_STATE_REQUEST |
                                            Ci.nsIWebProgress.NOTIFY_LOCATION);
       }
     }
   },
 
   showAmbientPopup: function SocialToolbar_showAmbientPopup(aToolbarButtonBox) {
+    // Hide any other social panels that may be open.
+    SocialFlyout.panel.hidePopup();
+
     let panel = document.getElementById("social-notification-panel");
     let notificationFrameId = aToolbarButtonBox.getAttribute("notificationFrameId");
     let notificationFrame = document.getElementById(notificationFrameId);
 
     // Clear dimensions on all browsers so the panel size will
     // only use the selected browser.
     let frameIter = panel.firstElementChild;
     while (frameIter) {