diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-16 01:06:24 -0700 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-16 01:06:24 -0700 |
commit | 46f59b165e5bd1908509e8a62b67bf983cfd6224 (patch) | |
tree | 0de426136cd0050eb3f1f8249bafeb0614f8af2d /apps/files/js/file-upload.js | |
parent | c20f01bbf0a1fe00efcdbd01898cdbdf76aafcb0 (diff) | |
parent | 7854cf04eec68da83655a819f081d2f2e12f607b (diff) | |
download | nextcloud-server-46f59b165e5bd1908509e8a62b67bf983cfd6224.tar.gz nextcloud-server-46f59b165e5bd1908509e8a62b67bf983cfd6224.zip |
Merge pull request #4838 from owncloud/refactor_upload_js
refactor upload js & html to always use only js to fill form data
Diffstat (limited to 'apps/files/js/file-upload.js')
-rw-r--r-- | apps/files/js/file-upload.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 970aad1f978..aeb2da90d5f 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -46,6 +46,15 @@ $(document).ready(function() { $('#uploadprogresswrapper input.stop').show(); } }, + submit: function(e, data) { + if ( ! data.formData ) { + // noone set update parameters, we set the minimum + data.formData = { + requesttoken: oc_requesttoken, + dir: $('#dir').val() + }; + } + }, /** * called after the first add, does NOT have the data param * @param e @@ -141,15 +150,8 @@ $(document).ready(function() { $('#uploadprogressbar').fadeOut(); } }; - var file_upload_handler = function() { - $('#file_upload_start').fileupload(file_upload_param); - }; - - - - if ( document.getElementById('data-upload-form') ) { - $(file_upload_handler); - } + $('#file_upload_start').fileupload(file_upload_param); + $.assocArraySize = function(obj) { // http://stackoverflow.com/a/6700/11236 var size = 0, key; |