Roo/bootstrap/DocumentManager.js
authoredward <edward@roojs.com>
Thu, 3 Mar 2016 04:44:49 +0000 (12:44 +0800)
committeredward <edward@roojs.com>
Thu, 3 Mar 2016 04:44:49 +0000 (12:44 +0800)
Roo/bootstrap/DocumentManager.js

index 953408b..63f4b0f 100644 (file)
@@ -607,32 +607,28 @@ Roo.extend(Roo.bootstrap.DocumentManager, Roo.bootstrap.Component,  {
     {
         var xhr = new XMLHttpRequest();
         
-        Roo.each(this.files, function(file, index){
-            if(typeof(file.id) != 'undefined' && file.id * 1 > 0){
-                return;
-            }
-            
-            file.xhr = xhr;
+        if(typeof(file.id) != 'undefined' && file.id * 1 > 0){
+            this.arrange();
+            return;
+        }
+        
+        file.xhr = xhr;
             
-            this.managerEl.createChild({
-                tag : 'div',
-                cls : 'roo-document-manager-loading',
-                cn : [
-                    {
-                        tag : 'div',
-                        tooltip : file.name,
-                        cls : 'roo-document-manager-thumb',
-                        html : '<i class="fa fa-spinner fa-pulse"></i>'
-                    }
-                ]
+        this.managerEl.createChild({
+            tag : 'div',
+            cls : 'roo-document-manager-loading',
+            cn : [
+                {
+                    tag : 'div',
+                    tooltip : file.name,
+                    cls : 'roo-document-manager-thumb',
+                    html : '<i class="fa fa-spinner fa-pulse"></i>'
+                }
+            ]
 
-            });
-            
-        }, this);
-        
-        if(this.files.length > this.boxes - 1 ){
-            this.uploader.hide();
-        }
+        });
+
+        xhr.open(this.method, this.url, true);
         
         var headers = {
             "Accept": "application/json",
@@ -640,8 +636,6 @@ Roo.extend(Roo.bootstrap.DocumentManager, Roo.bootstrap.Component,  {
             "X-Requested-With": "XMLHttpRequest"
         };
         
-        xhr.open(this.method, this.url, true);
-        
         for (var headerName in headers) {
             var headerValue = headers[headerName];
             if (headerValue) {