headheader in ItemPaneManager.registerSection()

This commit is contained in:
Dan Stillman 2024-03-30 04:42:45 -04:00
parent 5b1f2f4f90
commit 56e02b3cad
2 changed files with 6 additions and 6 deletions

View file

@ -277,7 +277,7 @@
// Create
let currentPaneIDs = currentPaneElements.map(elem => elem.dataset.pane);
for (let section of targetPanes) {
let { paneID, head, sidenav, bodyXHTML,
let { paneID, header, sidenav, bodyXHTML,
onInit, onDestroy, onItemChange, onRender, onAsyncRender, onToggle,
sectionButtons } = section;
if (currentPaneIDs.includes(paneID)) continue;
@ -285,7 +285,7 @@
elem.dataset.sidenavOptions = JSON.stringify(sidenav || {});
elem.paneID = paneID;
elem.bodyXHTML = bodyXHTML;
elem.registerSectionIcon({ icon: head.icon, darkIcon: head.darkIcon });
elem.registerSectionIcon({ icon: header.icon, darkIcon: header.darkIcon });
elem.registerHook({ type: "init", callback: onInit });
elem.registerHook({ type: "destroy", callback: onDestroy });
elem.registerHook({ type: "itemChange", callback: onItemChange });
@ -298,8 +298,8 @@
}
}
this._paneParent.append(elem);
elem.setL10nID(head.l10nID);
elem.setL10nArgs(head.l10nArgs);
elem.setL10nID(header.l10nID);
elem.setL10nArgs(header.l10nArgs);
this._intersectionOb.observe(elem);
this.sidenav.addPane(paneID);
}

View file

@ -68,7 +68,7 @@
* @type {object}
* @property {string} paneID - Unique pane ID
* @property {string} pluginID - Set plugin ID to auto remove section when plugin is disabled/removed
* @property {SectionL10n & SectionIcon} head - Header options. Icon should be 16*16 and `label` need to be localized
* @property {SectionL10n & SectionIcon} header - Header options. Icon should be 16*16 and `label` need to be localized
* @property {SectionL10n & SectionIcon} sidenav - Sidenav options. Icon should be 20*20 and `tooltiptext` need to be localized
* @property {string} [bodyXHTML] - Pane body's innerHTML, default to XUL namespace
* @property {(props: SectionInitHookArgs) => void} [onInit]
@ -208,7 +208,7 @@ class ItemPaneManager {
let requiredParamsType = {
paneID: "string",
pluginID: "string",
head: (val) => {
header: (val) => {
if (typeof val != "object") {
return "ItemPaneManager section options head must be object";
}