Sha256: 1edd9fb8ec8586ea5feec81abb231f980db3422a5593dfba1200f70568bdd03d
Contents?: true
Size: 616 Bytes
Versions: 65
Compression:
Stored size: 616 Bytes
Contents
import FileFieldController from "koi/controllers/file_field_controller"; export default class DocumentFieldController extends FileFieldController { connect() { this.initialPreviewContent = this.filenameTag.text; } setPreviewContent(content) { this.filenameTag.innerText = content; } showPreview(file) { const reader = new FileReader(); reader.onload = (e) => { if (this.filenameTag) { this.filenameTag.innerText = file.name; } }; reader.readAsDataURL(file); } get filenameTag() { return this.previewTarget.querySelector("p.preview-filename"); } }
Version data entries
65 entries across 65 versions & 1 rubygems