aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/js
diff options
context:
space:
mode:
authorJohannes Zellner <johannes@cloudron.io>2018-05-18 21:23:02 +0200
committerJohannes Zellner <johannes@cloudron.io>2018-05-18 21:23:02 +0200
commit7c36adbbc51c85c9073c72e75d6503b52c02561d (patch)
treec2d1b6869cb3b7d6bc576fd282482cb3646d3663 /frontend/js
parent3df9f8a6fc959eaa0924722ad9ce0675d80369f9 (diff)
downloadSurfer-7c36adbbc51c85c9073c72e75d6503b52c02561d.tar.gz
Surfer-7c36adbbc51c85c9073c72e75d6503b52c02561d.tar.zst
Surfer-7c36adbbc51c85c9073c72e75d6503b52c02561d.zip
We cannot have one button/input type for both folders and files for upload
Diffstat (limited to 'frontend/js')
-rw-r--r--frontend/js/app.js15
1 files changed, 13 insertions, 2 deletions
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({
256 var that = this; 256 var that = this;
257 257
258 $(this.$refs.upload).on('change', function () { 258 $(this.$refs.upload).on('change', function () {
259
260 // detach event handler 259 // detach event handler
261 $(that.$refs.upload).off('change'); 260 $(that.$refs.upload).off('change');
262
263 uploadFiles(that.$refs.upload.files || []); 261 uploadFiles(that.$refs.upload.files || []);
264 }); 262 });
265 263
@@ -267,6 +265,19 @@ var app = new Vue({
267 this.$refs.upload.value = ''; 265 this.$refs.upload.value = '';
268 this.$refs.upload.click(); 266 this.$refs.upload.click();
269 }, 267 },
268 onUploadFolder: function () {
269 var that = this;
270
271 $(this.$refs.uploadFolder).on('change', function () {
272 // detach event handler
273 $(that.$refs.uploadFolder).off('change');
274 uploadFiles(that.$refs.uploadFolder.files || []);
275 });
276
277 // reset the form first to make the change handler retrigger even on the same file selected
278 this.$refs.uploadFolder.value = '';
279 this.$refs.uploadFolder.click();
280 },
270 onDelete: function (entry) { 281 onDelete: function (entry) {
271 var that = this; 282 var that = this;
272 283