roojs-bootstrap.js
authoredward <edward@roojs.com>
Thu, 10 May 2018 06:08:09 +0000 (14:08 +0800)
committeredward <edward@roojs.com>
Thu, 10 May 2018 06:08:09 +0000 (14:08 +0800)
roojs-bootstrap-debug.js

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

index 761c874..67622fe 100644 (file)
@@ -8038,6 +8038,7 @@ clientValidation  Boolean          Applies to submit only.  Pass true to call fo
 
         return this;
     },
+    
     getItems : function()
     {
         var r=new Roo.util.MixedCollection(false, function(o){
@@ -8059,10 +8060,7 @@ clientValidation  Boolean          Applies to submit only.  Pass true to call fo
 
         iter(this);
         return r;
-
-
-
-
+        
     }
 
 });
@@ -28669,7 +28667,7 @@ Roo.extend(Roo.bootstrap.DocumentManager, Roo.bootstrap.Component,  {
     {
         this.selectorEl.dom.value = '';
         
-        if(!this.files.length){
+        if(!this.files || !this.files.length){
             return;
         }
         
index f85da00..834419f 100644 (file)
@@ -1214,7 +1214,7 @@ this.uploader.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';thi
 },renderProgressDialog:function(){var A=this;this.progressDialog=new Roo.bootstrap.Modal({cls:'roo-document-manager-progress-dialog',allow_close:false,title:'',buttons:[{name:'cancel',weight:'danger',html:'Cancel'}],listeners:{btnclick:function(){A.uploadCancel();
 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);
+}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||!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=[];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);