a11yist/app/javascript/controllers/details_list_controller.js
david 644969c613
Some checks failed
/ Run tests (push) Successful in 1m45s
/ Run system tests (push) Failing after 2m18s
/ Build, push and deploy image (push) Successful in 3m27s
Hotkeys ux
2024-11-09 05:08:46 +01:00

23 lines
487 B
JavaScript

import { Controller } from "@hotwired/stimulus"
// Connects to data-controller="details-list"
export default class extends Controller {
connect() {
}
openAll(e) {
console.log(e)
e.preventDefault();
this.element.querySelectorAll("details").forEach(el => {
el.setAttribute("open", "")
})
}
closeAll(e) {
console.log(e)
e.preventDefault();
this.element.querySelectorAll("details").forEach(el => {
el.removeAttribute("open")
})
}
}