1// @swarm_description: Stimulus controller for inline edit toggle - shows/hides edit form within table row 2import { Controller } from "@hotwired/stimulus" 3 4export default class extends Controller { 5 static targets = ["display", "form"] 6 7 toggle(event) { 8 event.preventDefault() 9 // Toggle all display targets (multiple table cells) 10 this.displayTargets.forEach(target => target.classList.toggle("hidden")) 11 this.formTarget.classList.toggle("hidden") 12 13 // Focus the first input in the form when showing 14 if (!this.formTarget.classList.contains("hidden")) { 15 const input = this.formTarget.querySelector("input[type='text']") 16 if (input) { 17 input.focus() 18 input.select() 19 } 20 } 21 } 22 23 cancel(event) { 24 event.preventDefault() 25 // Show all display targets 26 this.displayTargets.forEach(target => target.classList.remove("hidden")) 27 this.formTarget.classList.add("hidden") 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.