1import { EVENTS } from 'util.events' 2import { unlockMobileScrolling } from 'util.a11y' 3 4class MobileFiltersTrigger extends HTMLElement { 5 connectedCallback() { 6 this.isOpen = false 7 this.abortController = new AbortController() 8 unlockMobileScrolling() 9 this.trigger = this.querySelector('.collection-filter__btn') 10 this.trigger.addEventListener('click', this.handleClick.bind(this), { signal: this.abortController.signal }) 11 } 12 13 disconnectedCallback() { 14 this.abortController.abort() 15 } 16 17 handleClick() { 18 this.isOpen = !this.isOpen 19 this.trigger.classList.toggle('is-active', this.isOpen) 20 document.dispatchEvent(new CustomEvent(EVENTS.toggleMobileFilters, { detail: { isOpen: this.isOpen } })) 21 } 22} 23 24customElements.define('mobile-filters-trigger', MobileFiltersTrigger)
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.