Merge pull request 'Correction ref compétences' (#536) from lehmann/ScoDoc-Front:master into master

Reviewed-on: https://scodoc.org/git/ScoDoc/ScoDoc/pulls/536
This commit is contained in:
Emmanuel Viennet 2022-11-28 19:15:26 +01:00
commit 199b0c68be

View File

@ -61,7 +61,7 @@ class ref_competences extends HTMLElement {
let divCompetence = document.createElement("div");
divCompetence.innerText = `${competence} ${niveauCle.niveau}`;
divCompetence.style.gridRowStart = annee;
divCompetence.style.gridColumnStart = competence;
divCompetence.style.gridColumnStart = competence.replaceAll(" ", "_");
divCompetence.className = "comp" + numComp;
divCompetence.dataset.competence = `${competence} ${niveauCle.niveau}`;
divCompetence.addEventListener("click", (event) => { this.AC(event, competence, niveauCle.niveau, annee, numComp) })
@ -76,9 +76,9 @@ class ref_competences extends HTMLElement {
let gridTemplate = "";
Object.keys(this.data.competences).forEach(competence => {
if (competencesBucket.indexOf(competence) == -1) {
gridTemplate += `[${competence}] 0`;
gridTemplate += `[${competence.replaceAll(" ", "_")}] 0`;
} else {
gridTemplate += `[${competence}] 1fr`;
gridTemplate += `[${competence.replaceAll(" ", "_")}] 1fr`;
}
})
this.shadow.querySelector(".competences").style.gridTemplateColumns = gridTemplate;