Move some UI to Stimulus + Lo Pozzo geojson

This commit is contained in:
2024-11-27 11:48:03 +01:00
parent 8ef3331b25
commit 211379b986
9 changed files with 107 additions and 64 deletions

View File

@@ -1,17 +1,22 @@
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ['list', 'menu'];
static targets = ['list', 'menu', 'icon'];
toggleMenu(event) {
toggleMenu() {
/*
const target = event.currentTarget;
const id = target.getAttribute('data-id');
const icon = this.iconTargets.find(i => i.getAttribute('data-id') === id);
*/
this.menuTarget.classList.toggle('is-hidden');
//this.toggleIcon(icon);
//this.openList(`#${id}-list`);
}
this.openList(`#${id}-list`);
console.log(this.menuTarget);
close() {
this.menuTarget.classList.add('is-hidden');
}
openList(id) {

View File

@@ -0,0 +1,14 @@
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ['close', 'modal'];
open() {
this.modalTarget.classList.add('is-active');
}
close() {
this.modalTarget.classList.remove('is-active');
}
}