Correction ref compétences

This commit is contained in:
Sébastien Lehmann 2022-11-28 18:03:48 +01:00
parent 7653342142
commit 594bbd84fd

View File

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