Bug 809274. Avoid setting the sidebar visibility to the same value. r=felipe

This commit is contained in:
Mark Hammond 2012-11-14 15:27:41 +11:00
parent 41ddfe3144
commit 37543d52c9

View File

@ -925,7 +925,11 @@ var SocialSidebar = {
setSidebarVisibilityState: function(aEnabled) {
let sbrowser = document.getElementById("social-sidebar-browser");
sbrowser.docShell.isActive = aEnabled;
// it's possible we'll be called twice with aEnabled=false so let's
// just assume we may often be called with the same state.
if (aEnabled == sbrowser.docShellIsActive)
return;
sbrowser.docShellIsActive = aEnabled;
let evt = sbrowser.contentDocument.createEvent("CustomEvent");
evt.initCustomEvent(aEnabled ? "socialFrameShow" : "socialFrameHide", true, true, {});
sbrowser.contentDocument.documentElement.dispatchEvent(evt);