X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=frontend%2Fjs%2Fapp.js;h=9d7bacaa1cd4887420714d558972aea1aa7ba420;hb=7c36adbbc51c85c9073c72e75d6503b52c02561d;hp=dce3a602e43f42e8e487318d5b4c46977374be4d;hpb=3df9f8a6fc959eaa0924722ad9ce0675d80369f9;p=perso%2FImmae%2FProjets%2FNodejs%2FSurfer.git diff --git a/frontend/js/app.js b/frontend/js/app.js index dce3a60..9d7baca 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -256,10 +256,8 @@ var app = new Vue({ var that = this; $(this.$refs.upload).on('change', function () { - // detach event handler $(that.$refs.upload).off('change'); - uploadFiles(that.$refs.upload.files || []); }); @@ -267,6 +265,19 @@ var app = new Vue({ this.$refs.upload.value = ''; this.$refs.upload.click(); }, + onUploadFolder: function () { + var that = this; + + $(this.$refs.uploadFolder).on('change', function () { + // detach event handler + $(that.$refs.uploadFolder).off('change'); + uploadFiles(that.$refs.uploadFolder.files || []); + }); + + // reset the form first to make the change handler retrigger even on the same file selected + this.$refs.uploadFolder.value = ''; + this.$refs.uploadFolder.click(); + }, onDelete: function (entry) { var that = this;