Sha256: cbf74f84ba97118e7348f7a34ed0e395d4ab97bc3417e6239dfcab7fb853625e
Contents?: true
Size: 729 Bytes
Versions: 36
Compression:
Stored size: 729 Bytes
Contents
import ApplicationController from "satis/controllers/application_controller" export default class FileController extends ApplicationController { static targets = ["selection", "input"] connect() { this.boundUpdate = this.update.bind(this) this.inputTarget.addEventListener("change", this.boundUpdate) this.update() } disconnect() { this.inputTarget.removeEventListener("change", this.boundUpdate) } update(evt) { this.selectionTarget.innerHTML = "" Array.from(this.inputTarget.files).forEach((file) => { this.selectionTarget.innerHTML += `${file.name}<br>` }) } toggle(value) { // FIXME: We should capture the current content and update the template it came from. } }
Version data entries
36 entries across 36 versions & 1 rubygems