Fix apv2, WIP
This commit is contained in:
@@ -96,6 +96,10 @@ export default class VermineBaseActorSheet extends HandlebarsApplicationMixin(fo
|
||||
// ── Contexte commun ─────────────────────────────────────────────────
|
||||
|
||||
async _prepareContext() {
|
||||
const enrich = async (path) => {
|
||||
const val = foundry.utils.getProperty(this.document.system, path);
|
||||
return val ? await foundry.applications.ux.TextEditor.implementation.enrichHTML(val, { async: true }) : "";
|
||||
};
|
||||
return {
|
||||
fields: this.document.schema.fields,
|
||||
systemFields: this.document.system.schema.fields,
|
||||
@@ -107,7 +111,10 @@ export default class VermineBaseActorSheet extends HandlebarsApplicationMixin(fo
|
||||
isGM: game.user.isGM,
|
||||
isEditMode: this.isEditMode,
|
||||
isPlayMode: this.isPlayMode,
|
||||
isEditable: this.isEditable
|
||||
isEditable: this.isEditable,
|
||||
enrichedNotes: await enrich("identity.notes"),
|
||||
enrichedBiography: await enrich("identity.biography"),
|
||||
enrichedRelations: await enrich("identity.relations")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,6 +145,19 @@ export default class VermineBaseActorSheet extends HandlebarsApplicationMixin(fo
|
||||
for (const [group, tab] of Object.entries(this.tabGroups ?? {})) {
|
||||
this.changeTab(tab, group, {force: true})
|
||||
}
|
||||
// Move toggle from hidden main tab to visible position (only for sheets where
|
||||
// .tab.main is not already displayed as a permanent sidebar via !important)
|
||||
const mainTab = this.element.querySelector(".tab.main")
|
||||
const tabs = this.element.querySelector('nav.tabs[data-application-part="tabs"]')
|
||||
if ( mainTab && tabs && getComputedStyle(mainTab).display === "none" ) {
|
||||
const existing = tabs.parentNode.querySelector('.sheet-header-toggle[data-moved]')
|
||||
if (existing) existing.remove()
|
||||
const toggle = mainTab.querySelector(".sheet-header-toggle")
|
||||
if (toggle) {
|
||||
toggle.dataset.moved = "true"
|
||||
tabs.parentNode.insertBefore(toggle, tabs)
|
||||
}
|
||||
}
|
||||
this.#dragDrop.forEach(d => d.bind(this.element))
|
||||
this.element.querySelectorAll(".rollable").forEach(el => {
|
||||
el.addEventListener("click", this._onRoll.bind(this))
|
||||
|
||||
Reference in New Issue
Block a user