Repository: cloudstack
Updated Branches:
  refs/heads/ui-template-uploader 2188e19ed -> d2a928dbf


WIP: progress bar


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d2a928db
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d2a928db
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d2a928db

Branch: refs/heads/ui-template-uploader
Commit: d2a928dbf6c5dcb17665122056ea9f73b3a9efc2
Parents: 2188e19
Author: Brian Federle <[email protected]>
Authored: Tue Jan 6 15:48:50 2015 -0800
Committer: Brian Federle <[email protected]>
Committed: Tue Jan 6 15:48:50 2015 -0800

----------------------------------------------------------------------
 ui/scripts/templates.js | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d2a928db/ui/scripts/templates.js
----------------------------------------------------------------------
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index 51008cb..3ae46b7 100644
--- a/ui/scripts/templates.js
+++ b/ui/scripts/templates.js
@@ -116,8 +116,18 @@
                                 fileUpload: {
                                     action: function(args) {
                                         var fileData = args.fileData;
+                                        var ajax = $.ajax({
+                                            xhr: function() {
+                                                var xhr = 
jQuery.ajaxSettings.xhr();
 
-                                        $.ajax({
+                                                if (xhr instanceof 
window.XMLHttpRequest) {
+                                                    
xhr.upload.addEventListener('progress', function(e) {
+                                                        console.log('progress 
-> ', e);
+                                                    });
+                                                }
+
+                                                return xhr;
+                                            },
                                             url: '/test-upload.php',
                                             type: 'POST',
                                             data: fileData,
@@ -133,6 +143,8 @@
                                                 args.response.error('Error 
uploading files');
                                             }
                                         });
+
+                                        debugger;
                                     }
                                 },
                                 fields: {

Reply via email to