diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index 24843180a4f..638bb27d318 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -113,8 +113,17 @@ fileUpload: { getURL: function(args) { args.response.success({ - data: 'http://10.223.183.3/test-upload.json' + url: 'http://10.223.183.3/test-upload.php' }); + }, + postUpload: function(args) { + // Called when upload is done to do + // verification checks; + // i.e., poll the server to verify successful upload + // + // success() will close the dialog and call standard action + // error() will keep dialog open if user wants to re-submit + args.response.success(); } }, fields: { diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js index b20cbe70406..7e36b5cbd14 100644 --- a/ui/scripts/ui/dialog.js +++ b/ui/scripts/ui/dialog.js @@ -684,20 +684,52 @@ } var uploadFiles = function() { - $form.prepend($('
').addClass('loading-overlay').text('Uploading files...')); + $form.prepend($('
').addClass('loading-overlay')); args.form.fileUpload.getURL({ formData: data, context: args.context, response: { success: function(successArgs) { - var $uploadFrame = $('