PageSourceSearch

https://pika.page/assets/controllers/checkbox_revealable_controlle…22360256eb30fa6a351abae133524930ca4fd106.js

js pika.page collected 2026-10-03 21:44:43 UTC 498 bytes, 17 lines download raw bytes

1import { Controller } from "@hotwired/stimulus"
2
3export default class extends Controller {
4  static targets = ["checkbox", "content", "field"]
5
6  toggle() {
7    const revealed = this.checkboxTarget.checked
8    this.contentTarget.classList.toggle("hidden", !revealed)
9    this.fieldTargets.forEach((field) => (field.disabled = !revealed))
10    if (revealed) this.focusContent()
11  }
12
13  focusContent() {
14    const field = this.fieldTargets[0]
15    if (field) setTimeout(() => field.focus(), 100)
16  }
17};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.