Skip to content

Commit

Permalink
Fix: Check if content object(page) is set to _isOptional and unlock p…
Browse files Browse the repository at this point in the history
…ageNav button if set to _lockUntilPageComplete (fixes #64)
  • Loading branch information
oliverfoster authored May 1, 2024
2 parents 584ff23 + 4f28deb commit 3647bf7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/PageNavModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class PageNavModel extends ComponentModel {

const buttonTypeModels = this.getButtonTypeModels();
const currentPageComplete = buttonTypeModels._page.get('_isComplete');
const currentPageOptional = buttonTypeModels._page.get('_isOptional');
const unsortedItems = [];
let order = 0;
let item;
Expand Down Expand Up @@ -57,7 +58,7 @@ class PageNavModel extends ComponentModel {
index: 0,
order: order++,
_tooltipId: `pagenav_btn${type}`,
locked: item._isLocked || (buttonConfig._lockUntilPageComplete && !currentPageComplete)
locked: !currentPageOptional && (item._isLocked || (buttonConfig._lockUntilPageComplete && !currentPageComplete))
});
unsortedItems.push(item);
}
Expand Down

0 comments on commit 3647bf7

Please sign in to comment.