Bug 802784 - Possible to have two social panels open at once. r=mixedpuppy
authorJared Wein <jwein@mozilla.com>
Sun, 21 Oct 2012 17:28:37 -0700
changeset 111143 d0daa527d1b419727f6e0721b2e723f4319b8338
parent 111142 ca0bbaaf02821fdca0f783d7543a0c10f6fb9592
child 111144 4d001420453d78b13351daa7d29ab54ac4fcde52
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersmixedpuppy
bugs802784
milestone19.0a1
Bug 802784 - Possible to have two social panels open at once. r=mixedpuppy
browser/base/content/browser-social.js
--- a/browser/base/content/browser-social.js
+++ b/browser/base/content/browser-social.js
@@ -362,16 +362,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;
 
@@ -815,16 +818,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) {