mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-10 23:07:47 +00:00
20 lines
438 B
JavaScript
20 lines
438 B
JavaScript
import ApplicationController from "./application_controller";
|
|
|
|
export default class extends ApplicationController {
|
|
static targets = ["filename", "fileinput"];
|
|
static values = {
|
|
message: String,
|
|
};
|
|
|
|
connect() {
|
|
super.connect();
|
|
this.fileinputTarget.addEventListener("change", (event) => {
|
|
this.filenameTarget.innerText = event.target.files[0].name;
|
|
});
|
|
}
|
|
|
|
add() {
|
|
this.fileinputTarget.click();
|
|
}
|
|
}
|