Closed Bug 1223127 Opened 9 years ago Closed 6 years ago

CUI create view api

Categories

(Firefox :: Toolbars and Customization, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX
Tracking Status
firefox45 --- affected

People

(Reporter: mixedpuppy, Unassigned)

Details

Add-ons that programmatically add a CUI widget must also manually create the view.  I'm using onBeforeCreated to do this:

onBeforeCreated: function(doc) {
  if (doc.getElementById("PanelUI-pocketView"))
    return;  
  let view = doc.createElement("panelview");
  view.id = "PanelUI-pocketView";  
  let panel = doc.createElement("vbox");
  panel.setAttribute("class", "panel-subview-body");
  view.appendChild(panel);
  doc.getElementById("PanelUI-multiView").appendChild(view);
}

This is prone to error and susceptible to upgrade issues down the road if CUI changes.  It would be great if there were an API to have CUI create the view for us, or even a simple flag on the widget class to indicate that the view needs to be created.
With the demise of XPCOM add-ons, I don't think we'll do this anymore.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.