Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A836C17EB7 for ; Tue, 6 Jan 2015 23:16:47 +0000 (UTC) Received: (qmail 3047 invoked by uid 500); 6 Jan 2015 23:16:47 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 2972 invoked by uid 500); 6 Jan 2015 23:16:47 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 2943 invoked by uid 99); 6 Jan 2015 23:16:47 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jan 2015 23:16:47 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 0398F9D1D98; Tue, 6 Jan 2015 23:16:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bfederle@apache.org To: commits@cloudstack.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/ui-template-uploader to ed903e3 Date: Tue, 6 Jan 2015 23:16:46 +0000 (UTC) Repository: cloudstack Updated Branches: refs/heads/ui-template-uploader ca824cb7f -> ed903e358 Properly pass file upload response to success() Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ed903e35 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ed903e35 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ed903e35 Branch: refs/heads/ui-template-uploader Commit: ed903e3589f6edc37fdca121a7375310a3f465ac Parents: ca824cb Author: Brian Federle Authored: Tue Jan 6 15:16:25 2015 -0800 Committer: Brian Federle Committed: Tue Jan 6 15:16:25 2015 -0800 ---------------------------------------------------------------------- ui/scripts/templates.js | 8 ++++++-- ui/scripts/ui/dialog.js | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed903e35/ui/scripts/templates.js ---------------------------------------------------------------------- diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index de9beaf..297eb61 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -110,6 +110,9 @@ title: 'label.action.register.template', docID: 'helpNetworkOfferingName', preFilter: cloudStack.preFilter.createTemplate, + + // Handles POST to upload server + // -- standard action handler won't be called until success() callback fileUpload: { action: function(args) { var fileData = args.fileData; @@ -121,9 +124,10 @@ cache: false, dataType: 'json', processData: false, // Don't process the files - contentType: false, // Set content type to false as jQuery will tell the server its a query string request + contentType: false, // jQuery will tell the server this is a query string request success: function(uploadData, textStatus, jqXHR) { - args.response.succes(); + // Files uploaded successfully; proceed to handle rest of action + args.response.succes({ data: uploadData }); }, error: function(error) { args.response.error('Error uploading files'); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed903e35/ui/scripts/ui/dialog.js ---------------------------------------------------------------------- diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js index b23fb56..98a9dfa 100644 --- a/ui/scripts/ui/dialog.js +++ b/ui/scripts/ui/dialog.js @@ -693,12 +693,12 @@ context: args.context, uploadData: formData, response: { - success: function() { + success: function(successArgs) { $form.find('.loading-overlay').remove(); $form.data('files', null); args.after({ - data: $.extend(data, { uploadData: uploadData }), + data: $.extend(data, { uploadData: successArgs.data }), ref: args.ref, // For backwards compatibility; use context context: args.context, $form: $form