Sha256: eea72cef7261c09a5b0b0f2f63f52461bdf7736d67402adf748b9a007b102654
Contents?: true
Size: 700 Bytes
Versions: 8
Compression:
Stored size: 700 Bytes
Contents
import { Controller } from "@hotwired/stimulus" import { useClickOutside } from 'stimulus-use' // simple controller to hide/show the filter modal export default class extends Controller { static targets = ["frame"] static values = { src: String, isOpen: {type: Boolean, default: false} } connect() { useClickOutside(this) } disconnect() { } open(event) { event.preventDefault() this.frameTarget.src = this.srcValue; this.isOpenValue = true } close(event) { if (this.isOpenValue) { event?.preventDefault() this.frameTarget.innerHTML = ""; this.isOpenValue = false } } clickOutside(event) { this.close(event) } }
Version data entries
8 entries across 8 versions & 1 rubygems