From 41fffeed257c46941dfa39e767502d8e7f57d0b3 Mon Sep 17 00:00:00 2001 From: Thea Hvalen Thodesen Date: Tue, 19 Sep 2023 12:19:29 +0200 Subject: [PATCH] KURSP-873: previous button showing in first page of module --- src/js/modules/menu.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/js/modules/menu.js b/src/js/modules/menu.js index ba7144c1..15cbaf37 100755 --- a/src/js/modules/menu.js +++ b/src/js/modules/menu.js @@ -280,8 +280,7 @@ export default (function() { if(moduleItemSequence && moduleItemSequence.items.length && moduleItemSequence.items[0].prev) { var prevItem = moduleItemSequence.items[0].prev; if(prevItem.indent) { - id = prevItem.id; - api.getModuleItemSequence(courseId, id, handlePrevModuleItem); + api.getModuleItemSequence(courseId, prevItem.id, handlePrevModuleItem); } else { var prevButton = $(".module-sequence-footer-button--previous"); var prevButtonLink = $(".module-sequence-footer-button--previous a"); @@ -297,8 +296,7 @@ export default (function() { if(moduleItemSequence && moduleItemSequence.items.length && moduleItemSequence.items[0].next) { var nextItem = moduleItemSequence.items[0].next; if(nextItem.indent) { - var id = nextItem.id; - api.getModuleItemSequence(courseId, id, handleNextModuleItem); + api.getModuleItemSequence(courseId, nextItem.id, handleNextModuleItem); } else { var nextButton = $(".module-sequence-footer-button--next"); var nextButtonLink = $(".module-sequence-footer-button--next a");