Sha256: b59db98349a638aa588effe7509a56c36374e70c1128e993e912b6796117506c
Contents?: true
Size: 558 Bytes
Versions: 15
Compression:
Stored size: 558 Bytes
Contents
import { Controller } from "@hotwired/stimulus"; export default class extends Controller { static targets = ["item"]; static classes = ["hidden"]; connect() { this.class = this.hasHiddenClass ? this.hiddenClass : "hidden"; } toggle() { this.itemTargets.forEach((item) => { item.classList.toggle(this.class); }); } show() { this.itemTargets.forEach((item) => { item.classList.remove(this.class); }); } hide() { this.itemTargets.forEach((item) => { item.classList.add(this.class); }); } }
Version data entries
15 entries across 15 versions & 2 rubygems