1import { Controller } from "@hotwired/stimulus" 2 3export default class extends Controller { 4 static targets = ["menu"] 5 6 toggle() { 7 this.menuTarget.classList.toggle("hidden") 8 } 9 10 close(event) { 11 if (!this.element.contains(event.target)) { 12 this.menuTarget.classList.add("hidden") 13 } 14 } 15 16 connect() { 17 this.boundClose = this.close.bind(this) 18 document.addEventListener("click", this.boundClose) 19 } 20 21 disconnect() { 22 document.removeEventListener("click", this.boundClose) 23 } 24}
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.