Skip to content

Commit

Permalink
Update custom-character-sheet-sections.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jessev14 committed Mar 7, 2024
1 parent ab6dc1a commit 62bcd43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/custom-character-sheet-sections.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,17 @@ async function characterSheet2getData(wrapped, ...args) {
else newOrder.splice(index, 1, sec);
}
data[type] = newOrder;
await this.actor.setFlag(moduleID, `sectionOrder-${type}`, newOrder.map(s => s.dataset.type));
}
return data;
}

async function characterSheet2_render(wrapped, ...args) {
await wrapped(...args);
if (!this.actor.isOwner) return;

for (const type of ['inventory', 'features']) {
const sectionElement = this.element[0].querySelector(`section[data-item-list="${type}"]`);
const sectionElement = this.element[0]?.querySelector(`section[data-item-list="${type}"]`);
if (!sectionElement) continue;

sectionElement.querySelectorAll('div.items-section.card').forEach(div => {
Expand Down

0 comments on commit 62bcd43

Please sign in to comment.