Commit e41fd8d8 by Johannes Zellner

Clear the file input prior to triggering it

This ensures the change event is fired even if the file didn't change

Fixes #2
1 parent 0cce5096
Showing with 6 additions and 1 deletions
...@@ -107,8 +107,10 @@ ...@@ -107,8 +107,10 @@
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<center> <center>
<input type='file' v-el:upload style="display: none" id="uploadInput"/> <form id="fileUploadForm">
<input type="file" v-el:upload style="display: none" id="uploadInput"/>
<button class="btn btn-primary" v-on:click="upload()" id="uploadButton">Upload</button> <button class="btn btn-primary" v-on:click="upload()" id="uploadButton">Upload</button>
</form>
</center> </center>
<br/> <br/>
</div> </div>
......
...@@ -143,6 +143,9 @@ function upload() { ...@@ -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(); app.$els.upload.click();
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!