1import { Controller } from "@hotwired/stimulus" 2import { PopupCardTemplate } from "controllers/popup_application/popup_card_template"; 3 4 5 6export default class extends Controller { 7 static values = { name: String } 8 9 connect() { 10 const svgString = PopupCardTemplate.icons[this.nameValue] 11 if (!svgString) { 12 console.warn(`No icon for "${this.nameValue}"`) 13 return 14 } 15 16 // 1) Inject 17 this.element.innerHTML = svgString 18 19 // 2) Grab the <svg> we just injected 20 const svg = this.element.querySelector("svg") 21 if (!svg) return 22 23 // 3) Remove its built-in size class 24 svg.removeAttribute("class") 25 26 // 4) Make it fill the wrapper & inherit color 27 svg.classList.add("w-full", "h-full", "fill-current", "stroke-current") 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.