1import { Controller } from "@hotwired/stimulus" 2 3export default class extends Controller { 4 5 #maxHeight = 240 6 #baseFontSize = "var(--title_font)" 7 8 connect() { 9 this.#updateFontSize() 10 $('body').on('inlineEdit:rendered:all', () => this.#updateFontSize()) 11 } 12 13 #updateFontSize() { 14 const height = this.element.offsetHeight 15 if (height === 0) return 16 17 if (height > this.#maxHeight) { 18 const fontSize = `calc(${this.#maxHeight / this.element.offsetHeight} * ${this.#baseFontSize})` 19 this.element.style.setProperty('font-size', fontSize); 20 } 21 } 22}
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.