Sha256: 95264447268a96367716ec81de815de6dc859519f41ca62695ce51fca13abcbb
Contents?: true
Size: 781 Bytes
Versions: 27
Compression:
Stored size: 781 Bytes
Contents
import { Controller } from "@hotwired/stimulus" export default class extends Controller { selectImage(event) { let image = event.currentTarget this.image = image } instantInsert(event) { this.confirm(event) this.element.closest('.modal').modal.close() } confirm(event) { let imageSelectedEvent = new CustomEvent("media-picker:done", {detail: this.imageData}) this.target.dispatchEvent(imageSelectedEvent) } get target() { return document.getElementById(this.element.dataset.target) } get imageData() { return { filename: this.image.dataset.filename, signedBlobId: this.image.dataset.signedBlobId, imageId: this.image.dataset.imageId, embeddedUrl: this.image.dataset.embeddedUrl, thumbnail: this.image.dataset.thumbnail } } }
Version data entries
27 entries across 27 versions & 1 rubygems