Sha256: f3ec76b07f52b770d6c2bdcc0b137833f4f7a3f59f067cebed488c39e8f1152f
Contents?: true
Size: 500 Bytes
Versions: 5
Compression:
Stored size: 500 Bytes
Contents
import { Controller } from '@hotwired/stimulus' export default class extends Controller { static targets = ['closeButton'] static classes = ['animation'] static values = { transition: Number } connect() { this.closeButtonTarget.focus() requestAnimationFrame(() => { this.element.classList.remove(...this.animationClasses) }) } close() { this.element.classList.add(...this.animationClasses) setTimeout(() => this.element.remove(), this.transitionValue) } }
Version data entries
5 entries across 5 versions & 1 rubygems