[+] Add index offset to nextCourse()

This commit is contained in:
Hykilpikonna
2019-10-20 21:10:53 -04:00
parent 861de56f10
commit ecbcca5f14
+4 -2
View File
@@ -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]))
}
/**