From ecbcca5f14764215449dfcee0f08cd7f339b418d Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sun, 20 Oct 2019 21:10:53 -0400 Subject: [PATCH] [+] Add index offset to nextCourse() --- src/components/navigation/navigation.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/navigation/navigation.ts b/src/components/navigation/navigation.ts index ead8e15..e9dac2a 100644 --- a/src/components/navigation/navigation.ts +++ b/src/components/navigation/navigation.ts @@ -80,8 +80,10 @@ export default class Navigation extends Vue /** * Move to the next course + * + * @param indexOffset Index offset (Eg. 1 for next) */ - public nextCourse() + public nextCourse(indexOffset: number) { // Find current course let courseId = this.activeIndex.split('/')[1]; @@ -90,7 +92,7 @@ export default class Navigation extends Vue let courseIndex = this.courses.findIndex(c => c.id == +courseId); // Set tab to the next index - this.updateIndex(CourseUtils.formatTabIndex(this.courses[courseIndex + 1])) + this.updateIndex(CourseUtils.formatTabIndex(this.courses[courseIndex + indexOffset])) } /**