mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 11:44:40 +00:00
fix(assessments): placing subject average trice
This commit is contained in:
+2
-12
@@ -757,7 +757,6 @@ async function handleNotices(node: Element): Promise<void> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async function handleSublink(sublink: string | undefined): Promise<void> {
|
async function handleSublink(sublink: string | undefined): Promise<void> {
|
||||||
switch (sublink) {
|
switch (sublink) {
|
||||||
case 'news':
|
case 'news':
|
||||||
@@ -2754,8 +2753,8 @@ async function handleAssessments(node: Element): Promise<void> {
|
|||||||
if (average === 0) return;
|
if (average === 0) return;
|
||||||
|
|
||||||
// Remove existing average section if it exists
|
// Remove existing average section if it exists
|
||||||
const existingAverage = document.querySelector('.average-section');
|
const existingAverage = document.querySelector('.AssessmentItem__AssessmentItem___2EZ95:first-child');
|
||||||
if (existingAverage) {
|
if (existingAverage?.querySelector('.AssessmentItem__title___2bELn')?.textContent === 'Subject Average') {
|
||||||
existingAverage.remove();
|
existingAverage.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2780,15 +2779,6 @@ async function handleAssessments(node: Element): Promise<void> {
|
|||||||
const assessmentsList = document.querySelector('.assessments .AssessmentList__items___3LcmQ');
|
const assessmentsList = document.querySelector('.assessments .AssessmentList__items___3LcmQ');
|
||||||
if (assessmentsList && averageElement.firstChild) {
|
if (assessmentsList && averageElement.firstChild) {
|
||||||
assessmentsList.insertBefore(averageElement.firstChild, assessmentsList.firstChild);
|
assessmentsList.insertBefore(averageElement.firstChild, assessmentsList.firstChild);
|
||||||
|
|
||||||
// Add click handler for the collapse/expand button
|
|
||||||
const button = averageElement.firstChild as Element;
|
|
||||||
const buttonElement = button.querySelector('.Collapsible__expandBtn___25X1p');
|
|
||||||
const collapsible = button;
|
|
||||||
|
|
||||||
buttonElement?.addEventListener('click', () => {
|
|
||||||
collapsible.classList.toggle('Collapsible__expanded___1wlf0');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user