Skip to content

Commit e72064f

Browse files
committed
fix: add function for hypothetical grade calculator
Again just moving code into functions for better readability. Signed-off-by: Lucas Sta Maria <[email protected]>
1 parent be1c378 commit e72064f

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

src/js/saspowerschoolff.js

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,7 @@ function main_page () {
9999
}).$mount("#cumulative-gpa");
100100

101101
saveGradesLocally(student_name, courses);
102-
// Hypo Grade Calculator
103-
const HypoGradesDiv = document.createElement('div');
104-
HypoGradesDiv.classList.add("hypo-grade-div-fixed");
105-
HypoGradesDiv.id = "saspes-hypo-grades";
106-
document.body.appendChild(HypoGradesDiv);
107-
new (Vue.extend(HypoGrades))({
108-
propsData: {
109-
initialCourses: courses,
110-
},
111-
}).$mount(".hypo-grade-div-fixed");
102+
addHypoGradeCalc(courses);
112103
}
113104

114105
function class_page () {
@@ -308,3 +299,19 @@ function getFirstSemCourses () {
308299
});
309300
});
310301
}
302+
303+
/**
304+
* Adds the hypothetical grade calculator.
305+
* @param {courses} The courses of the student
306+
*/
307+
function addHypoGradeCalc (courses) {
308+
const HypoGradesDiv = document.createElement('div');
309+
HypoGradesDiv.classList.add("hypo-grade-div-fixed");
310+
HypoGradesDiv.id = "saspes-hypo-grades";
311+
document.body.appendChild(HypoGradesDiv);
312+
new (Vue.extend(HypoGrades))({
313+
propsData: {
314+
initialCourses: courses,
315+
},
316+
}).$mount(".hypo-grade-div-fixed");
317+
}

0 commit comments

Comments
 (0)