[O] Encapsulate rawSelectedTerm()
This commit is contained in:
+9
-2
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user