roojs-bootstrap.js
authoredward <edward@roojs.com>
Fri, 11 Mar 2016 09:45:39 +0000 (17:45 +0800)
committeredward <edward@roojs.com>
Fri, 11 Mar 2016 09:45:39 +0000 (17:45 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index aeeba1f..0d41ef6 100644 (file)
@@ -25901,6 +25901,8 @@ Roo.extend(Roo.bootstrap.DocumentManager, Roo.bootstrap.Component,  {
         
         var files = [];
         
+        var docs = [];
+        
         Roo.each(this.files, function(file){
             
             if(typeof(file.id) != 'undefined' && file.id * 1 > 0){
@@ -25909,7 +25911,17 @@ Roo.extend(Roo.bootstrap.DocumentManager, Roo.bootstrap.Component,  {
                 return;
             }
             
-            this.delegates.push(
+            if(file.type.indexOf('image') != -1){
+                this.delegates.push(
+                    (function(){
+                        _this.process(file);
+                    }).createDelegate(this)
+                );
+        
+                return;
+            }
+            
+            docs.push(
                 (function(){
                     _this.process(file);
                 }).createDelegate(this)
@@ -25919,6 +25931,8 @@ Roo.extend(Roo.bootstrap.DocumentManager, Roo.bootstrap.Component,  {
         
         this.files = files;
         
+        this.delegates = this.delegates.concat(docs);
+        
         if(!this.delegates.length){
             this.refresh();
             return;
index 4eaca3f..20d7d4c 100644 (file)
@@ -1079,12 +1079,12 @@ this.uploader.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';thi
 this.hide();}}});this.progressDialog.render(Roo.get(document.body));this.progress=new Roo.bootstrap.Progress({cls:'roo-document-manager-progress',active:true,striped:true});this.progress.render(this.progressDialog.getChildContainer());this.progressBar=new Roo.bootstrap.ProgressBar({cls:'roo-document-manager-progress-bar',aria_valuenow:0,aria_valuemin:0,aria_valuemax:12,panel:'success'});
 this.progressBar.render(this.progress.getChildContainer());},onUploaderClick:function(e){e.preventDefault();if(this.fireEvent('beforeselectfile',this)!=false){this.selectorEl.dom.click();}},onFileSelected:function(e){e.preventDefault();if(typeof(this.selectorEl.dom.files)=='undefined'||!this.selectorEl.dom.files.length){return;
 }Roo.each(this.selectorEl.dom.files,function(A){if(this.fireEvent('inspect',this,A)!=false){this.files.push(A);}},this);this.queue();},queue:function(){this.selectorEl.dom.value='';if(!this.files.length){return;}if(this.boxes>0&&this.files.length>this.boxes){this.files=this.files.slice(0,this.boxes);
-}this.uploader.show();if(this.boxes>0&&this.files.length>this.boxes-1){this.uploader.hide();}var A=this;var B=[];Roo.each(this.files,function(C){if(typeof(C.id)!='undefined'&&C.id*1>0){var f=this.renderPreview(C);B.push(f);return;}this.delegates.push((function(){A.process(C);
-}).createDelegate(this));},this);this.files=B;if(!this.delegates.length){this.refresh();return;}this.progressBar.aria_valuemax=this.delegates.length;this.arrange();return;},arrange:function(){if(!this.delegates.length){this.progressDialog.hide();this.refresh();
-return;}var A=this.delegates.shift();this.progressDialog.show();this.progressDialog.setTitle((this.progressBar.aria_valuemax-this.delegates.length)+' / '+this.progressBar.aria_valuemax);this.progressBar.update(this.progressBar.aria_valuemax-this.delegates.length);
-A();},refresh:function(){this.uploader.show();if(this.boxes>0&&this.files.length>this.boxes-1){this.uploader.hide();}Roo.isTouch?this.closable(false):this.closable(true);this.fireEvent('refresh',this);},onRemove:function(e,el,o){e.preventDefault();this.fireEvent('remove',this,o);
-},remove:function(o){var A=[];Roo.each(this.files,function(B){if(typeof(B.id)=='undefined'||B.id*1<1||B.id!=o.id){A.push(B);return;}o.target.remove();},this);this.files=A;this.refresh();},clear:function(){Roo.each(this.files,function(A){if(!A.target){return;
-}A.target.remove();},this);this.files=[];this.refresh();},onClick:function(e,el,o){e.preventDefault();this.fireEvent('click',this,o);},closable:function(A){Roo.each(this.managerEl.select('.roo-document-manager-preview > button.close',true).elements,function(el){el.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';
+}this.uploader.show();if(this.boxes>0&&this.files.length>this.boxes-1){this.uploader.hide();}var A=this;var B=[];var C=[];Roo.each(this.files,function(D){if(typeof(D.id)!='undefined'&&D.id*1>0){var f=this.renderPreview(D);B.push(f);return;}if(D.type.indexOf('image')!=-1){this.delegates.push((function(){A.process(D);
+}).createDelegate(this));return;}C.push((function(){A.process(D);}).createDelegate(this));},this);this.files=B;this.delegates=this.delegates.concat(C);if(!this.delegates.length){this.refresh();return;}this.progressBar.aria_valuemax=this.delegates.length;this.arrange();
+return;},arrange:function(){if(!this.delegates.length){this.progressDialog.hide();this.refresh();return;}var A=this.delegates.shift();this.progressDialog.show();this.progressDialog.setTitle((this.progressBar.aria_valuemax-this.delegates.length)+' / '+this.progressBar.aria_valuemax);
+this.progressBar.update(this.progressBar.aria_valuemax-this.delegates.length);A();},refresh:function(){this.uploader.show();if(this.boxes>0&&this.files.length>this.boxes-1){this.uploader.hide();}Roo.isTouch?this.closable(false):this.closable(true);this.fireEvent('refresh',this);
+},onRemove:function(e,el,o){e.preventDefault();this.fireEvent('remove',this,o);},remove:function(o){var A=[];Roo.each(this.files,function(B){if(typeof(B.id)=='undefined'||B.id*1<1||B.id!=o.id){A.push(B);return;}o.target.remove();},this);this.files=A;this.refresh();
+},clear:function(){Roo.each(this.files,function(A){if(!A.target){return;}A.target.remove();},this);this.files=[];this.refresh();},onClick:function(e,el,o){e.preventDefault();this.fireEvent('click',this,o);},closable:function(A){Roo.each(this.managerEl.select('.roo-document-manager-preview > button.close',true).elements,function(el){el.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';
 if(A){el.show();return;}el.hide();},this);},xhrOnLoad:function(A){Roo.each(this.managerEl.select('.roo-document-manager-loading',true).elements,function(el){el.remove();},this);if(A.readyState!==4){this.arrange();this.fireEvent('exception',this,A);return;
 }var B=Roo.decode(A.responseText);if(!B.success){this.arrange();this.fireEvent('exception',this,A);return;}var C=this.renderPreview(B.data);this.files.push(C);this.arrange();},xhrOnError:function(){Roo.log('xhr on error');var A=Roo.decode(xhr.responseText);
 Roo.log(A);this.arrange();},process:function(A){if(this.editable&&A.type.indexOf('image')!=-1){this.fireEvent('edit',this,A);return;}this.uploadStart(A,false);return;},uploadStart:function(A,B){this.xhr=new XMLHttpRequest();if(typeof(A.id)!='undefined'&&A.id*1>0){this.arrange();