This ensures the change event is fired even if the file didn't change
Fixes #2
<div class="row">
<div class="col-lg-12">
<center>
- <input type='file' v-el:upload style="display: none" id="uploadInput"/>
- <button class="btn btn-primary" v-on:click="upload()" id="uploadButton">Upload</button>
+ <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>
+ </form>
</center>
<br/>
</div>
});
});
+ // reset the form first to make the change handler retrigger even on the same file selected
+ $('#fileUploadForm')[0].reset();
+
app.$els.upload.click();
}