Sha256: 9a2e0acf33f0f7b8853d14b286ac3ee5a38d0c2ac12bed85a3d2e1c68d925a7d
Contents?: true
Size: 399 Bytes
Versions: 8
Compression:
Stored size: 399 Bytes
Contents
import { Controller } from '@hotwired/stimulus' export default class extends Controller { static targets = ['modal', 'backdrop'] static values = { closeModalOnBackdropClick: true, } close() { if (event.target === this.backdropTarget && !this.closeModalOnBackdropClickValue) return this.modalTarget.remove() document.dispatchEvent(new Event('actions-modal:close')) } }
Version data entries
8 entries across 8 versions & 1 rubygems