Skip to content

Commit

Permalink
Minor style fixes to map journal pages
Browse files Browse the repository at this point in the history
  • Loading branch information
arbron committed Nov 20, 2023
1 parent e344231 commit e36f9e0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
12 changes: 5 additions & 7 deletions module/applications/journal/journal-sheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ export default class JournalSheet5e extends JournalSheet {
for ( const page of pageData ) {
const pageDocument = this.document.pages.get(page._id);
let needsAdjustment = true;
if ( foundry.utils.getType(pageDocument?.system?.adjustTOCNumbering) === "function" ) {
const numbering = pageDocument.system.adjustTOCNumbering(page.number);
if ( numbering ) {
page.number = numbering.number;
adjustment += numbering.adjustment ?? 0;
needsAdjustment = false;
}
const numbering = pageDocument.system.adjustTOCNumbering?.(page.number);
if ( numbering ) {
page.number = numbering.number;
adjustment += numbering.adjustment ?? 0;
needsAdjustment = false;
}
if ( needsAdjustment ) page.number += adjustment;
}
Expand Down
1 change: 1 addition & 0 deletions module/applications/journal/map-page-sheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default class JournalMapLocationPageSheet extends JournalTextPageSheet {

/* -------------------------------------------- */

/** @inheritdoc */
async _renderInner(...args) {
const jQuery = await super._renderInner(...args);
const editingHeader = jQuery[0].querySelector(".journal-header");
Expand Down
2 changes: 1 addition & 1 deletion module/data/journal/map.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class MapLocationJournalPageData extends foundry.abstract.DataMod
/**
* Adjust the number of this entry in the table of contents.
* @param {number} number Current position number.
* @returns {{ number: string, adjustment: [number] }|void}
* @returns {{ number: string, adjustment: number }|void}
*/
adjustTOCNumbering(number) {
if ( !this.code ) return;
Expand Down

0 comments on commit e36f9e0

Please sign in to comment.