-Roo.bootstrap.DocumentManager=function(A){Roo.bootstrap.DocumentManager.superclass.constructor.call(this,A);this.addEvents({"inspect":true,"exception":true,"prepare":true,"remove":true,"refresh":true,"click":true});};Roo.extend(Roo.bootstrap.DocumentManager,Roo.bootstrap.Component,{boxes:12,inputName:'',minWidth:300,minHeight:300,thumbSize:300,multiple:true,files:[],method:'POST',url:'',paramName:'imageUpload',getAutoCreate:function(){var A={tag:'div',cls:'roo-document-manager',cn:[{tag:'input',cls:'roo-document-manager-selector',type:'file'},{tag:'div',cls:'roo-document-manager-uploader',cn:[{tag:'div',cls:'roo-document-manager-upload-btn',html:'<i class="fa fa-plus"></i>'}]}]};
-return A;},initEvents:function(){this.selectorEl=this.el.select('.roo-document-manager-selector',true).first();this.selectorEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.selectorEl.hide();if(this.multiple){this.selectorEl.attr('multiple','multiple');
-}this.selectorEl.on('change',this.onSelect,this);this.uploader=this.el.select('.roo-document-manager-uploader',true).first();this.uploader.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.uploader.on('click',this.onUpload,this);var A=this;
-window.addEventListener("resize",function(){A.refresh();});},onUpload:function(e){e.preventDefault();this.selectorEl.dom.click();},onSelect: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.process();},process:function(){this.selectorEl.dom.value='';if(!this.files.length){return;}if(this.files.length>12){this.files=this.files.slice(0,12);
-}var A=new XMLHttpRequest();Roo.each(this.files,function(G,H){if(typeof(G.id)!='undefined'&&G.id*1>0){return;}G.xhr=A;this.el.createChild({tag:'div',cls:'roo-document-manager-loading',cn:[{tag:'div',tooltip:G.name,cls:'roo-document-manager-thumb',html:'<i class="fa fa-spinner fa-pulse"></i>'}]});
-},this);if(this.files.length>11){this.uploader.hide();}var B={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};A.open(this.method,this.url,true);for(var C in B){var D=B[C];if(D){A.setRequestHeader(C,D);}}var E=this;
-A.onload=function(){E.xhrOnLoad(A);};A.onerror=function(){E.xhrOnError(A);};var F=new FormData();F.append('returnHTML','NO');Roo.each(this.files,function(G,H){if(typeof(G.id)!='undefined'&&G.id*1>0){return;}F.append(this.getParamName(H),G,G.name);},this);
-if(this.fireEvent('prepare',this,F)!=false){A.send(F);};},getParamName:function(i){if(!this.multiple){return this.paramName;}return this.paramName+"_"+i;},refresh:function(){Roo.each(this.el.select('.roo-document-manager-loading',true).elements,function(el){el.remove();
-},this);var A=[];Roo.each(this.files,function(B){if(typeof(B.id)=='undefined'||B.id*1<1){return;}if(B.target){A.push(B);return;}var C=this.el.createChild({tag:'div',cls:'roo-document-manager-preview',cn:[{tag:'div',tooltip:B.filename,cls:'roo-document-manager-thumb',html:'<img src="'+baseURL+'/Images/Thumb/'+this.thumbSize+'/'+B.id+'/'+B.filename+'">'},{tag:'button',cls:'close',html:'x'}]});
+Roo.bootstrap.DocumentManager=function(A){Roo.bootstrap.DocumentManager.superclass.constructor.call(this,A);this.addEvents({"inspect":true,"exception":true,"prepare":true,"remove":true,"refresh":true,"click":true});};Roo.extend(Roo.bootstrap.DocumentManager,Roo.bootstrap.Component,{boxes:12,inputName:'',minWidth:300,minHeight:300,thumbSize:300,multiple:true,files:[],method:'POST',url:'',paramName:'imageUpload',fieldLabel:'',labelWidth:4,labelAlign:'left',getAutoCreate:function(){var A={tag:'div',cls:'roo-document-manager',cn:[{tag:'input',cls:'roo-document-manager-selector',type:'file'},{tag:'div',cls:'roo-document-manager-uploader',cn:[{tag:'div',cls:'roo-document-manager-upload-btn',html:'<i class="fa fa-plus"></i>'}]}]};
+var B=[{tag:'div',cls:'column col-md-12',cn:A}];if(this.fieldLabel.length){B=[{tag:'div',cls:'column col-md-12',html:this.fieldLabel},{tag:'div',cls:'column col-md-12',cn:A}];if(this.labelAlign=='left'){B=[{tag:'div',cls:'column col-md-'+this.labelWidth,html:this.fieldLabel},{tag:'div',cls:'column col-md-'+(12-this.labelWidth),cn:A}];
+}}var C={tag:'div',cls:'row clearfix',cn:B};return C;},initEvents:function(){this.managerEl=this.el.select('.roo-document-manager',true).first();this.managerEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.selectorEl=this.el.select('.roo-document-manager-selector',true).first();
+this.selectorEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.selectorEl.hide();if(this.multiple){this.selectorEl.attr('multiple','multiple');}this.selectorEl.on('change',this.onSelect,this);this.uploader=this.el.select('.roo-document-manager-uploader',true).first();
+this.uploader.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.uploader.on('click',this.onUpload,this);var A=this;window.addEventListener("resize",function(){A.refresh();});},onUpload:function(e){e.preventDefault();this.selectorEl.dom.click();
+},onSelect: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.process();},process:function(){this.selectorEl.dom.value='';if(!this.files.length){return;}if(this.files.length>12){this.files=this.files.slice(0,12);}var A=new XMLHttpRequest();Roo.each(this.files,function(G,H){if(typeof(G.id)!='undefined'&&G.id*1>0){return;
+}G.xhr=A;this.managerEl.createChild({tag:'div',cls:'roo-document-manager-loading',cn:[{tag:'div',tooltip:G.name,cls:'roo-document-manager-thumb',html:'<i class="fa fa-spinner fa-pulse"></i>'}]});},this);if(this.files.length>11){this.uploader.hide();}var B={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};
+A.open(this.method,this.url,true);for(var C in B){var D=B[C];if(D){A.setRequestHeader(C,D);}}var E=this;A.onload=function(){E.xhrOnLoad(A);};A.onerror=function(){E.xhrOnError(A);};var F=new FormData();F.append('returnHTML','NO');Roo.each(this.files,function(G,H){if(typeof(G.id)!='undefined'&&G.id*1>0){return;
+}F.append(this.getParamName(H),G,G.name);},this);if(this.fireEvent('prepare',this,F)!=false){A.send(F);};},getParamName:function(i){if(!this.multiple){return this.paramName;}return this.paramName+"_"+i;},refresh:function(){Roo.each(this.managerEl.select('.roo-document-manager-loading',true).elements,function(el){el.remove();
+},this);var A=[];Roo.each(this.files,function(B){if(typeof(B.id)=='undefined'||B.id*1<1){return;}if(B.target){A.push(B);return;}var C=this.managerEl.createChild({tag:'div',cls:'roo-document-manager-preview',cn:[{tag:'div',tooltip:B.filename,cls:'roo-document-manager-thumb',html:'<img src="'+baseURL+'/Images/Thumb/'+this.thumbSize+'/'+B.id+'/'+B.filename+'">'},{tag:'button',cls:'close',html:'x'}]});