Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Bug visuel lié à la variation de moyenne réglé et meilleur gestion du backdrop.
Visual bug related to the average variation fixed and better management of the backdrop.
  • Loading branch information
KaarisMoiLeCrane authored May 20, 2023
1 parent 311b458 commit b94b088
Show file tree
Hide file tree
Showing 4 changed files with 227 additions and 180 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,14 @@ globalThis.Notes.calculerVariationMoyenne = function (disciplineElmExclusion, aj

let numMatiere = disciplineElmExclusion.parentElement
numMatiere = Array.from(numMatiere.parentNode.children).indexOf(numMatiere)

if (disciplineElmExclusion instanceof HTMLElement) {
let observerConfig = {
childList: true
};

for (let i = 0; i < disciplineElmExclusion.children.length; i++) {
for (let i = 0; i < note.periodes[periodeNote].ensembleMatieres.disciplines[numMatiere].professeurs.length + 1; i++) {
if (!disciplineElmExclusion.querySelector("[kmlc-variation]"))
disciplineElmExclusion.appendChild(span)

if (disciplineElmExclusion.children[i] != disciplineElmExclusion.querySelector("[kmlc-variation]"))
disciplineElmExclusion.querySelector("[kmlc-variation]").appendChild(disciplineElmExclusion.children[i])
if (disciplineElmExclusion.children[0] != disciplineElmExclusion.querySelector("[kmlc-variation]"))
disciplineElmExclusion.querySelector("[kmlc-variation]").appendChild(disciplineElmExclusion.children[0])
}

if (!disciplineElmExclusion.className.includes("kmlc-note-parent")) {
Expand All @@ -87,12 +83,12 @@ globalThis.Notes.calculerVariationMoyenne = function (disciplineElmExclusion, aj

} else if (disciplineElmExclusion instanceof Object) {
for (let i = 0; i < disciplineElmExclusion.length; i++) {
for (let j = 0; j < disciplineElmExclusion[i].children.length; j++) {
for (let j = 0; j < note.periodes[periodeNote].ensembleMatieres.disciplines[numMatiere].professeurs.length + 1; j++) {
if (!disciplineElmExclusion[i].querySelector("[kmlc-variation]"))
disciplineElmExclusion[i].appendChild(span)

if (disciplineElmExclusion[i].children[j] != disciplineElmExclusion[i].querySelector("[kmlc-variation]"))
disciplineElmExclusion[i].querySelector("[kmlc-variation]").appendChild(disciplineElmExclusion[i].children[j])
if (disciplineElmExclusion[i].children[0] != disciplineElmExclusion[i].querySelector("[kmlc-variation]"))
disciplineElmExclusion[i].querySelector("[kmlc-variation]").appendChild(disciplineElmExclusion[i].children[0])
}

if (!disciplineElmExclusion[i].className.includes("kmlc-note-parent")) {
Expand Down
10 changes: 10 additions & 0 deletions ecoledirecte-plus-features/Notes/objectif.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ function fixerObjectif() {
// Get all the average without the average goal attribute (to know that the right click listener has been set)
let matieres = document.querySelectorAll("td[class *= 'relevemoyenne']:not([kmlc-objectif-moyenne])")

// For each average box set the right click listener (that let the user to set an average goal)
for (let i = 0; i < matieres.length; i++) {
matieres[i].setAttribute("kmlc-objectif-moyenne", "true")
}
}

function fixerObjectif2() {
// Get all the average without the average goal attribute (to know that the right click listener has been set)
let matieres = document.querySelectorAll("td[class *= 'relevemoyenne']:not([kmlc-objectif-moyenne])")

// For each average box set the right click listener (that let the user to set an average goal)
for (let i = 0; i < matieres.length; i++) {
matieres[i].setAttribute("kmlc-objectif-moyenne", "true")
Expand Down
Loading

0 comments on commit b94b088

Please sign in to comment.