|
@@ -5,7 +5,7 @@ export default class extends Controller {
|
|
|
connect() {
|
|
|
console.log("Stimulus: contrôleur de planning actif");
|
|
|
|
|
|
- this.arrows = this.element.querySelectorAll('[data-id]');
|
|
|
+ this.arrows = this.element.querySelectorAll('.period-controller');
|
|
|
this.showAll = this.element.querySelector('[data-store]');
|
|
|
this.containers = document.querySelectorAll('.period-panel');
|
|
|
|
|
@@ -41,9 +41,10 @@ export default class extends Controller {
|
|
|
if (this.showAll.dataset.action == "show") {
|
|
|
this.containers.forEach(container => {
|
|
|
container.classList.remove('is-hidden');
|
|
|
- this.showAll.dataset.action = "hide";
|
|
|
- this.showAll.innerHTML = 'Cacher les autres périodes';
|
|
|
});
|
|
|
+ this.showAll.dataset.action = "hide";
|
|
|
+ this.showAll.innerHTML = 'Cacher les autres périodes';
|
|
|
+ this.arrows.forEach(arrow => { console.log(arrow); arrow.classList.add('is-hidden') });
|
|
|
} else {
|
|
|
this.containers.forEach(container => {
|
|
|
if (container.id === this.showAll.dataset.store) {
|
|
@@ -51,6 +52,7 @@ export default class extends Controller {
|
|
|
} else {
|
|
|
container.classList.add('is-hidden');
|
|
|
}
|
|
|
+ this.arrows.forEach(arrow => { arrow.classList.remove('is-hidden') });
|
|
|
});
|
|
|
this.showAll.dataset.action = "show";
|
|
|
this.showAll.innerHTML = 'Afficher toutes les périodes à la suite';
|