[O] Encapsulate rawSelectedTerm()

This commit is contained in:
Hykilpikonna
2019-12-21 17:30:45 -05:00
parent a903b2cdfa
commit 916c586cbc
+9 -2
View File
@@ -184,8 +184,7 @@ export default class Course
{
return this.cache.get('GradingPeriods', () =>
{
let timeCode = Navigation.instance.getSelectedTerm();
return (timeCode == -1 ? [0, 1, 2, 3] : [timeCode]).filter(term =>
return (this.rawSelectedTerm == -1 ? [0, 1, 2, 3] : [this.rawSelectedTerm]).filter(term =>
this.termAssignments[term].filter(a => a.graded).length != 0);
})
}
@@ -344,4 +343,12 @@ export default class Course
{
return {hash: this.urlHash, title: this.name, identifier: 'course', info: {id: this.id}}
}
/**
* Selected term
*/
get rawSelectedTerm(): number
{
return Navigation.instance.getSelectedTerm()
}
}