From c380a753ec7a98957d678ea5cf0dca1293fc0142 Mon Sep 17 00:00:00 2001 From: stu Date: Wed, 1 May 2024 13:22:57 +0100 Subject: [PATCH 1/2] Update PageNavModel.js Account for isOptional set on content object --- js/PageNavModel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/PageNavModel.js b/js/PageNavModel.js index b5eeb1e..ea5d763 100644 --- a/js/PageNavModel.js +++ b/js/PageNavModel.js @@ -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; @@ -57,7 +58,7 @@ class PageNavModel extends ComponentModel { index: 0, order: order++, _tooltipId: `pagenav_btn${type}`, - locked: item._isLocked || (buttonConfig._lockUntilPageComplete && !currentPageComplete) + locked: (item._isLocked && !currentPageOptional) || ((buttonConfig._lockUntilPageComplete && !currentPageComplete) && !currentPageOptional) }); unsortedItems.push(item); } From 4f28debb5f7f2afc80e55ca563013016d1e15337 Mon Sep 17 00:00:00 2001 From: Stuart Date: Wed, 1 May 2024 14:03:37 +0100 Subject: [PATCH 2/2] Update js/PageNavModel.js Co-authored-by: Oliver Foster --- js/PageNavModel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/PageNavModel.js b/js/PageNavModel.js index ea5d763..7b7e3ca 100644 --- a/js/PageNavModel.js +++ b/js/PageNavModel.js @@ -58,7 +58,7 @@ class PageNavModel extends ComponentModel { index: 0, order: order++, _tooltipId: `pagenav_btn${type}`, - locked: (item._isLocked && !currentPageOptional) || ((buttonConfig._lockUntilPageComplete && !currentPageComplete) && !currentPageOptional) + locked: !currentPageOptional && (item._isLocked || (buttonConfig._lockUntilPageComplete && !currentPageComplete)) }); unsortedItems.push(item); }