Sha256: 1bb564f05f20d292c4ba4ef1891e9e213406cd5a64494e12df45fe19d903df28
Contents?: true
Size: 389 Bytes
Versions: 6
Compression:
Stored size: 389 Bytes
Contents
import { Controller } from "@hotwired/stimulus" export default class extends Controller { static targets = [ "children", "indicator" ] toggle(event) { this.childrenTarget.toggleAttribute("hidden") this.indicatorTarget.classList.toggle("rotate-90") if (this.collapsed) event.preventDefault() } get collapsed() { return this.childrenTarget.hidden } }
Version data entries
6 entries across 6 versions & 1 rubygems