Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby
408 B
Raw Blame
import { Controller } from "@hotwired/stimulus"

// Simple "select all" checkbox controller
// Connect to a container, specify which checkboxes to control via target
export default class extends Controller {
  static targets = ["checkbox", "selectAll"]

  toggle(event) {
    const checked = event.target.checked
    this.checkboxTargets.forEach((checkbox) => {
      checkbox.checked = checked
    })
  }
}