Bug 802784 - Possible to have two social panels open at once. r=mixedpuppy, a=gavin
--- 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) {