1import { Controller } from "@hotwired/stimulus" 2 3export default class extends Controller { 4 static targets = ["container", "template"] 5 6 add(event) { 7 event.preventDefault() 8 const content = this.templateTarget.innerHTML.replace(/NEW_RECORD/g, new Date().getTime()) 9 this.containerTarget.insertAdjacentHTML("beforeend", content) 10 } 11 12 remove(event) { 13 event.preventDefault() 14 const wrapper = event.target.closest("[data-nested-form-wrapper]") 15 if (wrapper) { 16 const destroyInput = wrapper.querySelector("input[name*='_destroy']") 17 if (destroyInput) { 18 destroyInput.value = "1" 19 wrapper.style.display = "none" 20 } else { 21 wrapper.remove() 22 } 23 } 24 } 25}
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.