sélection de l'algo de sélection
This commit is contained in:
45
script.js
45
script.js
@@ -17,37 +17,36 @@ for (let input of inputs) {
|
|||||||
|
|
||||||
input.onfocus = function (event) {
|
input.onfocus = function (event) {
|
||||||
for (li of document.querySelectorAll(
|
for (li of document.querySelectorAll(
|
||||||
`.definitions.horizontales > ol > li:nth-child(${input.y + 1}), .definitions.verticales > ol > li:nth-child(${input.x + 1})`
|
`.definitions.horizontales > ol > li:nth-child(${input.y + 1})`
|
||||||
)) {
|
)) {
|
||||||
li.classList.add("selectionee");
|
li.classList.add("selectionee");
|
||||||
|
for (liEnfant of li.querySelectorAll("li")) {
|
||||||
|
if (liEnfant.id == input.dataset.iddh) {
|
||||||
|
liEnfant.classList.add("selectionee");
|
||||||
|
} else {
|
||||||
|
liEnfant.classList.add("non-selectionee");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (li of document.querySelectorAll(
|
||||||
|
`.definitions.verticales > ol > li:nth-child(${input.x + 1})`
|
||||||
|
)) {
|
||||||
|
li.classList.add("selectionee");
|
||||||
|
for (liEnfant of li.querySelectorAll("li")) {
|
||||||
|
if (liEnfant.id == input.dataset.iddv) {
|
||||||
|
liEnfant.classList.add("selectionee");
|
||||||
|
} else {
|
||||||
|
liEnfant.classList.add("non-selectionee");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (li of document.querySelectorAll(
|
for (li of document.querySelectorAll(
|
||||||
`.definitions.horizontales > ol > li:not(:nth-child(${input.y + 1})), .definitions.verticales > ol > li:not(:nth-child(${input.x + 1}))`
|
`.definitions.horizontales > ol > li:not(:nth-child(${input.y + 1})), .definitions.verticales > ol > li:not(:nth-child(${input.x + 1}))`
|
||||||
)) {
|
)) {
|
||||||
li.classList.add("non-selectionee");
|
li.classList.add("non-selectionee");
|
||||||
}
|
}
|
||||||
if (input.dataset.iddh) {
|
|
||||||
for (li of document.querySelectorAll(`.definitions.horizontales ol li ol #${input.dataset.iddh}`)) {
|
input.select();
|
||||||
for (liVoisin of li.parentElement.querySelectorAll("li")) {
|
|
||||||
if (liVoisin == li) {
|
|
||||||
liVoisin.classList.add("selectionee");
|
|
||||||
} else {
|
|
||||||
liVoisin.classList.add("non-selectionee");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (input.dataset.iddv) {
|
|
||||||
for (li of document.querySelectorAll(`.definitions.verticales ol li ol #${input.dataset.iddv}`)) {
|
|
||||||
for (liVoisin of li.parentElement.querySelectorAll("li")) {
|
|
||||||
if (liVoisin == li) {
|
|
||||||
liVoisin.classList.add("selectionee");
|
|
||||||
} else {
|
|
||||||
liVoisin.classList.add("non-selectionee");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
input.onkeydown = function (event) {
|
input.onkeydown = function (event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user