From e41fd8d870087dafded21050f7895bb179060b2f Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Tue, 3 May 2016 14:53:57 +0200 Subject: [PATCH] Clear the file input prior to triggering it This ensures the change event is fired even if the file didn't change Fixes #2 --- app/index.html | 6 ++++-- app/js/app.js | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/index.html b/app/index.html index adb7591..93fa57e 100644 --- a/app/index.html +++ b/app/index.html @@ -107,8 +107,10 @@
- - +
+ + +

diff --git a/app/js/app.js b/app/js/app.js index 6017d25..f207de6 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -143,6 +143,9 @@ function upload() { }); }); + // reset the form first to make the change handler retrigger even on the same file selected + $('#fileUploadForm')[0].reset(); + app.$els.upload.click(); } -- 2.41.0