1import ApplicationController from "satis/controllers/application_controller" 2 3export default class SidebarComponentController extends ApplicationController { 4 connect() { 5 super.connect(); 6 this.boundHandleTurboRender = this.handleTurboRender.bind(this); 7 document.addEventListener("turbo:load", this.boundHandleTurboRender); 8 document.addEventListener("turbo:render", this.boundHandleTurboRender); 9 } 10 11 disconnect() { 12 super.disconnect(); 13 document.removeEventListener("turbo:load", this.boundHandleTurboRender); 14 document.removeEventListener("turbo:render", this.boundHandleTurboRender); 15 } 16 17 handleTurboRender() { 18 // Clear focus and let menu items handle it with their existing logic 19 requestAnimationFrame(() => { 20 const existingFocused = this.element.querySelectorAll('a.focus'); 21 existingFocused.forEach((link) => { 22 link.classList.remove('focus'); 23 }); 24 this.element.dispatchEvent(new CustomEvent("sts-sidebar:update-focus", { bubbles: true })); 25 }); 26 } 27} 28;
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.