Sha256: 4450014d84747d5cd30849390e156b321605154f426175878c202354e8f9d820
Contents?: true
Size: 1.01 KB
Versions: 66
Compression:
Stored size: 1.01 KB
Contents
import {Controller} from '@hotwired/stimulus' export default class SlideoverComponent extends Controller { static targets = ['expandable', 'expandWrapper', 'slidePanel', 'buttonWrapper'] declare readonly expandableTarget: HTMLDivElement declare readonly expandWrapperTarget: HTMLDivElement declare readonly slidePanelTargets: [HTMLDivElement] declare readonly buttonWrapperTarget: HTMLDivElement toggle() { this.expandableTarget.classList.toggle('ariadne-hidden') this.expandWrapperTarget.classList.toggle('bg-filter-panel') for (const slidePanel of this.slidePanelTargets) { slidePanel.classList.toggle('ariadne-hidden') } this.buttonWrapperTarget.classList.toggle('bg-filter-panel') if (document.getElementById('btnClose')?.classList.contains('ariadne-hidden')) { const formID = this.buttonWrapperTarget.getAttribute('data-slideover-component-form-id') if (formID) { const form = <HTMLFormElement>document.getElementById(formID) form?.submit() } } } }
Version data entries
66 entries across 66 versions & 1 rubygems