summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js/public.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/js/public.js')
-rw-r--r--apps/files_sharing/js/public.js23
1 files changed, 11 insertions, 12 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index ac121fd08e2..67320b1cdb6 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -7,8 +7,6 @@ function fileDownloadPath(dir, file) {
return url;
}
-var form_data;
-
$(document).ready(function() {
$('#data-upload-form').tipsy({gravity:'ne', fade:true});
@@ -50,17 +48,18 @@ $(document).ready(function() {
});
}
- // Add some form data to the upload handler
- file_upload_param.formData = {
- MAX_FILE_SIZE: $('#uploadMaxFilesize').val(),
- requesttoken: $('#publicUploadRequestToken').val(),
- dirToken: $('#dirToken').val(),
- appname: 'files_sharing',
- subdir: $('input#dir').val()
- };
+ var file_upload_start = $('#file_upload_start');
+ file_upload_start.on('fileuploadadd', function(e, data) {
+ // Add custom data to the upload handler
+ data.formData = {
+ requesttoken: $('#publicUploadRequestToken').val(),
+ dirToken: $('#dirToken').val(),
+ subdir: $('input#dir').val()
+ };
+ });
- // Add Uploadprogress Wrapper to controls bar
- $('#controls').append($('#additional_controls div#uploadprogresswrapper'));
+ // Add Uploadprogress Wrapper to controls bar
+ $('#controls').append($('#additional_controls div#uploadprogresswrapper'));
// Cancel upload trigger
$('#cancel_upload_button').click(function() {