roojs-bootstrap.js
[roojs1] / roojs-bootstrap.js
index f1d4c90..8ec2012 100644 (file)
@@ -561,8 +561,8 @@ C.cn.push({tag:'button',html:'x',cls:'roo-combo-removable-btn close'});}if(this.
 ]}]})}if(this.multiple){E.cls+=' roo-select2-container-multi';}var G=this.labelAlign||this.parentLabelAlign();A.cn=E;if(this.fieldLabel.length&&this.labelWidth){var lw=G==='left'?('col-sm'+this.labelWidth):'';var cw=G==='left'?('col-sm'+(12-this.labelWidth)):'';
 A.cn=[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'},{tag:'label',cls:'control-label '+lw,html:this.fieldLabel},{cls:cw,cn:[E]}];if(this.indicatorpos=='right'){A.cn=[{tag:'label',cls:'control-label '+lw,html:this.fieldLabel}
 ,{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'},{cls:cw,cn:[E]}];}}var H=this;['xs','sm','md','lg'].map(function(I){if(H[I]){A.cls+=' col-'+I+'-'+H[I];}});return A;},initTouchView:function(){this.renderTouchView();
-this.touchViewEl.on('scroll',function(){this.el.dom.scrollTop=0;},this);this.originalValue=this.getValue();this.triggerEl=this.el.select('span.dropdown-toggle',true).first();this.inputEl().on("click",this.showTouchView,this);this.triggerEl.on("click",this.showTouchView,this);
-this.touchViewFooterEl.select('.roo-touch-view-cancel',true).first().on('click',this.hideTouchView,this);this.touchViewFooterEl.select('.roo-touch-view-ok',true).first().on('click',this.setTouchViewValue,this);this.maskEl=new Roo.LoadMask(this.touchViewEl,{store:this.store,msgCls:'roo-el-mask-msg'}
+this.touchViewEl.on('scroll',function(){this.el.dom.scrollTop=0;},this);this.originalValue=this.getValue();this.triggerEl=this.el.select('span.dropdown-toggle',true).first();this.inputEl().on("click",this.showTouchView,this);if(this.triggerEl){this.triggerEl.on("click",this.showTouchView,this);
+}this.touchViewFooterEl.select('.roo-touch-view-cancel',true).first().on('click',this.hideTouchView,this);this.touchViewFooterEl.select('.roo-touch-view-ok',true).first().on('click',this.setTouchViewValue,this);this.maskEl=new Roo.LoadMask(this.touchViewEl,{store:this.store,msgCls:'roo-el-mask-msg'}
 );this.store.on('beforeload',this.onTouchViewBeforeLoad,this);this.store.on('load',this.onTouchViewLoad,this);this.store.on('loadexception',this.onTouchViewLoadException,this);if(this.hiddenName){this.hiddenField=this.el.select('input.form-hidden-field',true).first();
 this.hiddenField.dom.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';this.el.dom.removeAttribute('name');this.hiddenField.dom.setAttribute('name',this.hiddenName);}if(this.multiple){this.choices=this.el.select('ul.roo-select2-choices',true).first();
 this.searchField=this.el.select('ul li.roo-select2-search-field',true).first();}if(this.removable&&!this.multiple){var A=this.closeTriggerEl();if(A){A.setVisibilityMode(Roo.Element.DISPLAY).hide();A.on('click',this.removeBtnClick,this,A);}}this.inputEl().on("focus",function(e){document.activeElement.blur();
@@ -1169,7 +1169,7 @@ A();},refresh:function(){this.uploader.show();if(this.boxes>0&&this.files.length
 },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();this.fireEvent('afterupload',this,A);},xhrOnError:function(A){Roo.log('xhr on error');
+}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();this.fireEvent('onUpload',this,A);},xhrOnError:function(A){Roo.log('xhr on error');
 var B=Roo.decode(A.responseText);Roo.log(B);this.arrange();},process:function(A){if(this.fireEvent('process',this,A)!==false){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();return;}A.xhr=this.xhr;this.managerEl.createChild({tag:'div',cls:'roo-document-manager-loading',cn:[{tag:'div',tooltip:A.name,cls:'roo-document-manager-thumb',html:'<i class="fa fa-circle-o-notch fa-spin"></i>'}
 ]});this.xhr.open(this.method,this.url,true);var C={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var D in C){var E=C[D];if(E){this.xhr.setRequestHeader(D,E);}}var F=this;this.xhr.onload=function(){F.xhrOnLoad(F.xhr);