Closed Infocatcher closed 10 years ago
resource:///modules/CustomizableWidgets.jsm
{
id: "sidebar-button",
type: "view",
viewId: "PanelUI-sidebar",
onViewShowing: function(aEvent) {
...
// First clear any existing menuitems then populate. Social sidebar
// options may not have been added yet, so we do that here. Add it to the
// standard menu first, then copy all sidebar options to the panel.
win.SocialSidebar.clearProviderMenus();
let providerMenuSeps = menu.getElementsByClassName("social-provider-menu");
if (providerMenuSeps.length > 0)
win.SocialSidebar.populateProviderMenu(providerMenuSeps[0]);
fillSubviewFromMenuItems([...menu.children], doc.getElementById("PanelUI-sidebarItems"));
}
But there is no usable notifications. :(
We have:
popupshowing
event (ugh!)ViewShowing
event (event.target.id == "PanelUI-sidebar"), but items is already cloned on this event.window.addEventListener("popupshowing", ..., true);
to wait for #customizationui-widget-panel: this doesn't work for first time.