PageSourceSearch

https://catalog.powellpro.net/assets/controllers/option_form_field…0b81f1d41debc395fb5d0aa6fa1699e4b0ea57d1.js

js powellpro.net collected 2026-09-28 03:48:06 UTC 731 bytes, 29 lines download raw bytes

1import { Controller } from "@hotwired/stimulus"
2
3export default class extends Controller {
4  static targets = ["textConfig", "selectionConfig"]
5
6  connect() {
7    this.applyVisibility(this.fieldTypeSelect())
8  }
9
10  toggle(event) {
11    this.applyVisibility(event.currentTarget)
12  }
13
14  fieldTypeSelect() {
15    return this.element.querySelector('select[name="option_form_field[field_type]"]')
16  }
17
18  applyVisibility(select) {
19    if (!select) return
20    const value = select.value
21    if (this.hasTextConfigTarget) {
22      this.textConfigTarget.classList.toggle("hidden", value !== "text")
23    }
24    if (this.hasSelectionConfigTarget) {
25      this.selectionConfigTarget.classList.toggle("hidden", value !== "selection")
26    }
27  }
28}
29;

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.