Finish getting the main item sheet completed and fully functional
This commit is contained in:
parent
2518c7cf05
commit
94b3ec923b
4 changed files with 103 additions and 14 deletions
|
|
@ -2,6 +2,7 @@ import { __ID__, filePath } from "../consts.mjs";
|
|||
|
||||
const { HandlebarsApplicationMixin } = foundry.applications.api;
|
||||
const { ItemSheetV2 } = foundry.applications.sheets;
|
||||
const { setProperty } = foundry.utils;
|
||||
|
||||
export class GenericItemSheet extends HandlebarsApplicationMixin(ItemSheetV2) {
|
||||
// #region Options
|
||||
|
|
@ -34,12 +35,38 @@ export class GenericItemSheet extends HandlebarsApplicationMixin(ItemSheetV2) {
|
|||
// #endregion Instance Data
|
||||
|
||||
// #region Lifecycle
|
||||
async _prepareContext(partID) {
|
||||
async _prepareContext() {
|
||||
return {
|
||||
meta: {
|
||||
idp: this.id,
|
||||
editable: this.isEditable,
|
||||
limited: this.isLimited
|
||||
},
|
||||
item: this.item,
|
||||
system: this.item.system,
|
||||
};
|
||||
};
|
||||
|
||||
async _preparePartContext(partID, ctx) {
|
||||
switch (partID) {
|
||||
case `content`: {
|
||||
await this._prepareContentContext(ctx);
|
||||
break;
|
||||
};
|
||||
};
|
||||
|
||||
return ctx;
|
||||
};
|
||||
|
||||
async _prepareContentContext(ctx) {
|
||||
const TextEditor = foundry.applications.ux.TextEditor.implementation;
|
||||
|
||||
setProperty(
|
||||
ctx,
|
||||
`enriched.system.description`,
|
||||
await TextEditor.enrichHTML(this.item.system.description),
|
||||
);
|
||||
};
|
||||
// #endregion Lifecycle
|
||||
|
||||
// #region Actions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue