document.getAnonymousElementByAttribute(this, "anonid", "iframe");
return this.getAttribute("minimized") == "true";
return this.iframe.docShell.isActive;
this.iframe.docShell.isActive = !!val;
// let the chat frame know if it is being shown or hidden
let evt = this.iframe.contentDocument.createEvent("CustomEvent");
evt.initCustomEvent(val ? "socialFrameShow" : "socialFrameHide", true, true, {});
this.iframe.contentDocument.documentElement.dispatchEvent(evt);
this.parentNode.selectedChat = this;
// to avoid reflows we cache the values for various widths.
this.cachedWidthOpen = 0;
this.cachedWidthMinimized = 0;
this.cachedWidthNub = 0;
this._selectedChat = null;
document.getAnonymousElementByAttribute(this, "anonid", "innerbox");
document.getAnonymousElementByAttribute(this, "anonid", "nubMenu");
document.getAnonymousElementByAttribute(this, "anonid", "nub");
new WeakMap()
new Map();
as it
// must exist before the (possibly delayed) bindings are created.
cb._callbacks = [aCallback];
// src also a javascript property; the src attribute is set in the ctor.
cb.src = aURL;
if (aMode == "minimized")
cb.setAttribute("minimized", "true");
cb.setAttribute("origin", aProvider.origin);
this.insertBefore(cb, this.firstChild);
this.selectedChat = cb;
this.chatboxForURL.set(aURL, Cu.getWeakReference(cb));
this.resize();
]]>
availWidth) {
// we need to collapse some.
let toCollapse = [];
for (let child of this.collapsibleChildren) {
if (currentWidth <= availWidth)
break;
toCollapse.push(child);
currentWidth -= this.getTotalChildWidth(child);
}
if (toCollapse.length) {
for (let child of toCollapse)
this.collapseChat(child);
}
} else if (currentWidth < availWidth) {
// we *might* be able to expand some - see how many.
// XXX - if this was clever, it could know when removing the nub
// leaves enough space to show all collapsed
let toShow = [];
for (let child of this.collapsedChildren) {
currentWidth += this.getTotalChildWidth(child);
if (currentWidth > availWidth)
break;
toShow.push(child);
}
for (let child of toShow)
this._showChat(child);
// If none remain collapsed remove the nub.
if (!this.hasCollapsedChildren) {
this.nub.collapsed = true;
}
}
// else: achievement unlocked - we are pixel-perfect!
]]>