null node.getAttribute("skipintoolbarset") != "true" && node.id) .map(node => node.id); CustomizableUI.registerToolbarNode(this, children); ]]> 0) { if (this.overflowable && this.overflowable.initialized) { this.overflowable.onOverflow(aEvent); } else { this.overflowedDuringConstruction = aEvent; } } else if (aEvent.type == "underflow" && aEvent.detail > 0) { this.overflowedDuringConstruction = null; } ]]> currentWidgets.has(x)).join(","); ]]> x); let oldIds = CustomizableUI.getWidgetIdsInArea(this.id); // Get a list of items only in the new list let newIds = newVal.filter(id => oldIds.indexOf(id) == -1); CustomizableUI.beginBatchUpdate(); try { for (let newId of newIds) { oldIds = CustomizableUI.getWidgetIdsInArea(this.id); let nextId = newId; let pos; do { // Get the next item nextId = newVal[newVal.indexOf(nextId) + 1]; // Figure out where it is in the old list pos = oldIds.indexOf(nextId); // If it's not in the old list, repeat: } while (pos == -1 && nextId); if (pos == -1) { pos = null; // We didn't find anything, insert at the end } CustomizableUI.addWidgetToArea(newId, this.id, pos); } let currentIds = this.currentSet.split(","); let removedIds = currentIds.filter(id => newIds.indexOf(id) == -1 && newVal.indexOf(id) == -1); for (let removedId of removedIds) { CustomizableUI.removeWidgetFromArea(removedId); } } finally { CustomizableUI.endBatchUpdate(); } ]]> this._setInactive(); this._setActive(); null true !!x)) { this._currentSetMigrated.add(migratedItem); } this.evictNodes(); // We can't easily use |this| or strong bindings for the observer fn here // because that creates leaky circular references when the node goes away, // and XBL destructors are unreliable. let mutationObserver = new MutationObserver(function(mutations) { if (!mutations.length) { return; } let toolbar = mutations[0].target; // Can't use our own attribute because we might not have one if we're set to // collapsed let areCustomizing = toolbar.ownerDocument.documentElement.getAttribute("customizing"); if (!toolbar._isModifying && !areCustomizing) { toolbar.evictNodes(); } }); mutationObserver.observe(this, {childList: true}); ]]> kItemMaxWidth) { throw new Error(aNode.id + " is too big (" + nodeWidth + "px wide), moving to the palette"); } CustomizableUI.addWidgetToArea(aNode.id, this._delegatingToolbar); movedOut = true; } catch (ex) { // This will throw if the node is too big, or can't be moved there for // some reason. Report this: Cu.reportError(ex); } } /* We won't have moved the widget if either the add-on bar was collapsed, * or if it was too wide to be inserted into the navbar. */ if (!movedOut) { try { CustomizableUI.removeWidgetFromArea(aNode.id); } catch (ex) { Cu.reportError(ex); aNode.remove(); } } // Surprise: addWidgetToArea(palette) will get you nothing if the palette // is not constructed yet. Fix: if (aNode.parentNode == oldParent) { let palette = this.toolbox.palette; if (palette && oldParent != palette) { palette.appendChild(aNode); } } ]]> node.id).join(","); ]]> x && (!this._whiteListed.has(x) && !CustomizableUI.isSpecialWidget(x) && !this._currentSetMigrated.has(x))); for (let newButton of newButtons) { this._currentSetMigrated.add(newButton); this.insertItem(newButton); } this._updateMigratedSet(); ]]> new Set(["addonbar-closebutton", "status-bar"]) false new Set()