Roo/bootstrap/TextArea.js
authoredward <edward@roojs.com>
Fri, 24 Jun 2016 09:06:56 +0000 (17:06 +0800)
committeredward <edward@roojs.com>
Fri, 24 Jun 2016 09:06:56 +0000 (17:06 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/bootstrap/TextArea.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 28b87af..97bd3c7 100644 (file)
@@ -137,7 +137,7 @@ Roo.extend(Roo.bootstrap.TextArea, Roo.bootstrap.Input,  {
         }
         
         if (align ==='left' && this.fieldLabel.length) {
-                Roo.log("left and has label");
+//                Roo.log("left and has label");
                 cfg.cn = [
                     
                     {
@@ -156,7 +156,7 @@ Roo.extend(Roo.bootstrap.TextArea, Roo.bootstrap.Input,  {
                     
                 ];
         } else if ( this.fieldLabel.length) {
-                Roo.log(" label");
+//                Roo.log(" label");
                  cfg.cn = [
                    
                     {
@@ -172,7 +172,7 @@ Roo.extend(Roo.bootstrap.TextArea, Roo.bootstrap.Input,  {
 
         } else {
             
-                   Roo.log(" no label && no align");
+//                   Roo.log(" no label && no align");
                 cfg.cn = [
                     
                         inputblock
index 32c399d..8274bce 100644 (file)
@@ -8663,7 +8663,7 @@ Roo.extend(Roo.bootstrap.TextArea, Roo.bootstrap.Input,  {
         }
         
         if (align ==='left' && this.fieldLabel.length) {
-                Roo.log("left and has label");
+//                Roo.log("left and has label");
                 cfg.cn = [
                     
                     {
@@ -8682,7 +8682,7 @@ Roo.extend(Roo.bootstrap.TextArea, Roo.bootstrap.Input,  {
                     
                 ];
         } else if ( this.fieldLabel.length) {
-                Roo.log(" label");
+//                Roo.log(" label");
                  cfg.cn = [
                    
                     {
@@ -8698,7 +8698,7 @@ Roo.extend(Roo.bootstrap.TextArea, Roo.bootstrap.Input,  {
 
         } else {
             
-                   Roo.log(" no label && no align");
+//                   Roo.log(" no label && no align");
                 cfg.cn = [
                     
                         inputblock
@@ -18603,7 +18603,7 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
         }
         
         if (align ==='left' && this.fieldLabel.length) {
-                Roo.log("left and has label");
+//                Roo.log("left and has label");
                 cfg.cn = [
                     
                     {
@@ -18622,7 +18622,7 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
                     
                 ];
         } else if ( this.fieldLabel.length) {
-                Roo.log(" label");
+//                Roo.log(" label");
                 cfg.cn = [
                    
                     {
@@ -18640,7 +18640,7 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
 
         } else {
             
-                Roo.log(" no label && no align");
+//                Roo.log(" no label && no align");
                 cfg.cn = [  inputblock ] ;
                 
                 
index a5c2db1..ea53068 100644 (file)
@@ -340,17 +340,17 @@ Roo.bootstrap.TextArea=function(A){Roo.bootstrap.TextArea.superclass.constructor
 var id=Roo.id();var B={};var C={tag:'textarea',id:id,warp:this.warp,rows:this.rows,value:this.value||'',html:this.html||'',cls:'form-control',placeholder:this.placeholder||''};if(this.maxLength&&this.maxLength!=Number.MAX_VALUE){C.maxLength=this.maxLength;
 }if(this.resize){C.style=(typeof(C.style)=='undefined')?'resize:'+this.resize:C.style+'resize:'+this.resize;}if(this.cols){C.cols=this.cols;}if(this.readOnly){C.readonly=true;}if(this.name){C.name=this.name;}if(this.size){C.cls=(typeof(C.cls)=='undefined')?'input-'+this.size:C.cls+' input-'+this.size;
 }var D=this;['xs','sm','md','lg'].map(function(G){if(D[G]){B.cls+=' col-'+G+'-'+D[G];}});var E=C;if(this.hasFeedback&&!this.allowBlank){var F={tag:'span',cls:'glyphicon form-control-feedback'};E={cls:'has-feedback',cn:[C,F]};}if(this.before||this.after){E={cls:'input-group',cn:[]}
-;if(this.before){E.cn.push({tag:'span',cls:'input-group-addon',html:this.before});}E.cn.push(C);if(this.hasFeedback&&!this.allowBlank){E.cls+=' has-feedback';E.cn.push(F);}if(this.after){E.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}}if(A==='left'&&this.fieldLabel.length){Roo.log("left and has label");
-B.cn=[{tag:'label','for':id,cls:'control-label col-sm-'+this.labelWidth,html:this.fieldLabel},{cls:"col-sm-"+(12-this.labelWidth),cn:[E]}];}else if(this.fieldLabel.length){Roo.log(" label");B.cn=[{tag:'label',html:this.fieldLabel},E];}else{Roo.log(" no label && no align");
-B.cn=[E];}if(this.disabled){C.disabled=true;}return B;},inputEl:function(){return this.el.select('textarea.form-control',true).first();},clearInvalid:function(){if(!this.el||this.preventMark){return;}var A=this.el.select('label',true).first();var B=this.el.select('i.fa-star',true).first();
-if(A&&B){B.remove();}this.el.removeClass(this.invalidClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var C=this.el.select('.form-control-feedback',true).first();if(C){this.el.select('.form-control-feedback',true).first().removeClass(this.invalidFeedbackClass);
-}}this.fireEvent('valid',this);},markValid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]);var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);
-}if(this.disabled||this.allowBlank){return;}var B=this.el.select('label',true).first();var C=this.el.select('i.fa-star',true).first();if(B&&C){C.remove();}this.el.addClass(this.validClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank&&(this.getValue().length||this.forceFeedback)){var A=this.el.select('.form-control-feedback',true).first();
-if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);this.el.select('.form-control-feedback',true).first().addClass([this.validFeedbackClass]);}}this.fireEvent('valid',this);},markInvalid:function(A){if(!this.el||this.preventMark){return;
-}this.el.removeClass([this.invalidClass,this.validClass]);var B=this.el.select('.form-control-feedback',true).first();if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.disabled||this.allowBlank){return;
-}var C=this.el.select('label',true).first();var D=this.el.select('i.fa-star',true).first();if(!this.getValue().length&&C&&!D){this.el.createChild({tag:'i',cls:'text-danger fa fa-lg fa-star',tooltip:'This field is required',style:'margin-right:5px;'},C,true);
-}this.el.addClass(this.invalidClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var B=this.el.select('.form-control-feedback',true).first();if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);
-if(this.getValue().length||this.forceFeedback){this.el.select('.form-control-feedback',true).first().addClass([this.invalidFeedbackClass]);}}}this.fireEvent('invalid',this,A);}});
+;if(this.before){E.cn.push({tag:'span',cls:'input-group-addon',html:this.before});}E.cn.push(C);if(this.hasFeedback&&!this.allowBlank){E.cls+=' has-feedback';E.cn.push(F);}if(this.after){E.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}}if(A==='left'&&this.fieldLabel.length){B.cn=[{tag:'label','for':id,cls:'control-label col-sm-'+this.labelWidth,html:this.fieldLabel}
+,{cls:"col-sm-"+(12-this.labelWidth),cn:[E]}];}else if(this.fieldLabel.length){B.cn=[{tag:'label',html:this.fieldLabel},E];}else{B.cn=[E];}if(this.disabled){C.disabled=true;}return B;},inputEl:function(){return this.el.select('textarea.form-control',true).first();
+},clearInvalid:function(){if(!this.el||this.preventMark){return;}var A=this.el.select('label',true).first();var B=this.el.select('i.fa-star',true).first();if(A&&B){B.remove();}this.el.removeClass(this.invalidClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var C=this.el.select('.form-control-feedback',true).first();
+if(C){this.el.select('.form-control-feedback',true).first().removeClass(this.invalidFeedbackClass);}}this.fireEvent('valid',this);},markValid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]);var A=this.el.select('.form-control-feedback',true).first();
+if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.disabled||this.allowBlank){return;}var B=this.el.select('label',true).first();var C=this.el.select('i.fa-star',true).first();
+if(B&&C){C.remove();}this.el.addClass(this.validClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank&&(this.getValue().length||this.forceFeedback)){var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);
+this.el.select('.form-control-feedback',true).first().addClass([this.validFeedbackClass]);}}this.fireEvent('valid',this);},markInvalid:function(A){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]);var B=this.el.select('.form-control-feedback',true).first();
+if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.disabled||this.allowBlank){return;}var C=this.el.select('label',true).first();var D=this.el.select('i.fa-star',true).first();
+if(!this.getValue().length&&C&&!D){this.el.createChild({tag:'i',cls:'text-danger fa fa-lg fa-star',tooltip:'This field is required',style:'margin-right:5px;'},C,true);}this.el.addClass(this.invalidClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var B=this.el.select('.form-control-feedback',true).first();
+if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);if(this.getValue().length||this.forceFeedback){this.el.select('.form-control-feedback',true).first().addClass([this.invalidFeedbackClass]);
+}}}this.fireEvent('invalid',this,A);}});
 // Roo/bootstrap/TriggerField.js
 Roo.bootstrap.TriggerField=function(A){this.mimicing=false;Roo.bootstrap.TriggerField.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.TriggerField,Roo.bootstrap.Input,{hideTrigger:false,removable:false,autoSize:Roo.emptyFn,monitorTab:true,deferHeight:true,actionMode:'wrap',caret:false,getAutoCreate:function(){var A=this.labelAlign||this.parentLabelAlign();
 var id=Roo.id();var B={cls:'form-group'};var C={tag:'input',id:id,type:this.inputType,cls:'form-control',autocomplete:'new-password',placeholder:this.placeholder||''};if(this.name){C.name=this.name;}if(this.size){C.cls+=' input-'+this.size;}if(this.disabled){C.disabled=true;
@@ -761,17 +761,16 @@ break;case 13:if(typeof(this.vIndex)!='undefined'&&!isNaN(this.vIndex)){this.set
 Roo.bootstrap.CheckBox=function(A){Roo.bootstrap.CheckBox.superclass.constructor.call(this,A);this.addEvents({check:true});};Roo.extend(Roo.bootstrap.CheckBox,Roo.bootstrap.Input,{inputType:'checkbox',inputValue:1,valueOff:0,boxLabel:false,checked:false,weight:false,inline:false,getAutoCreate:function(){var A=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign;
 var id=Roo.id();var B={};B.cls='form-group '+this.inputType;if(this.inline){B.cls+=' '+this.inputType+'-inline';}var C={tag:'input',id:id,type:this.inputType,value:this.inputType=='radio'?this.inputValue:((!this.checked)?this.valueOff:this.inputValue),cls:'roo-'+this.inputType,placeholder:this.placeholder||''}
 ;if(this.weight){B.cls+=" "+this.inputType+"-"+this.weight;}if(this.disabled){C.disabled=true;}if(this.checked){C.checked=this.checked;}if(this.name){C.name=this.name;}if(this.size){C.cls+=' input-'+this.size;}var D=this;['xs','sm','md','lg'].map(function(G){if(D[G]){B.cls+=' col-'+G+'-'+D[G];
-}});var E=C;if(this.before||this.after){E={cls:'input-group',cn:[]};if(this.before){E.cn.push({tag:'span',cls:'input-group-addon',html:this.before});}E.cn.push(C);if(this.after){E.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}}if(A==='left'&&this.fieldLabel.length){Roo.log("left and has label");
-B.cn=[{tag:'label','for':id,cls:'control-label col-md-'+this.labelWidth,html:this.fieldLabel},{cls:"col-md-"+(12-this.labelWidth),cn:[E]}];}else if(this.fieldLabel.length){Roo.log(" label");B.cn=[{tag:this.boxLabel?'span':'label','for':id,cls:'control-label box-input-label',html:this.fieldLabel}
-,E];}else{Roo.log(" no label && no align");B.cn=[E];}if(this.boxLabel){var F={tag:'label',cls:'box-label',html:this.boxLabel};if(this.tooltip){F.tooltip=this.tooltip;}B.cn.push(F);}return B;},inputEl:function(){return this.el.select('input.roo-'+this.inputType,true).first();
-},labelEl:function(){return this.el.select('label.control-label',true).first();},label:function(){return this.labelEl();},initEvents:function(){this.inputEl().on('click',this.onClick,this);if(this.boxLabel){this.el.select('label.box-label',true).first().on('click',this.onClick,this);
-}this.startValue=this.getValue();if(this.groupId){Roo.bootstrap.CheckBox.register(this);}},onClick:function(){this.setChecked(!this.checked);},setChecked:function(A,B){this.startValue=this.getValue();if(this.inputType=='radio'){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){e.dom.checked=false;
-});this.inputEl().dom.checked=true;this.inputEl().dom.value=this.inputValue;if(B!==true){this.fireEvent('check',this,true);}this.validate();return;}this.checked=A;this.inputEl().dom.checked=A;this.inputEl().dom.value=A?this.inputValue:this.valueOff;if(B!==true){this.fireEvent('check',this,A);
-}this.validate();},getValue:function(){if(this.inputType=='radio'){return this.getGroupValue();}return this.inputEl().getValue();},getGroupValue:function(){if(typeof(this.el.up('form').child('input[name='+this.name+']:checked',true))=='undefined'){return '';
-}return this.el.up('form').child('input[name='+this.name+']:checked',true).value;},setValue:function(v,A){if(this.inputType=='radio'){this.setGroupValue(v,A);return;}this.setChecked(((typeof(v)=='undefined')?this.checked:(String(v)===String(this.inputValue))),A);
-this.validate();},setGroupValue:function(v,A){this.startValue=this.getValue();Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){e.dom.checked=false;if(e.dom.value==v){e.dom.checked=true;}});if(A!==true){this.fireEvent('check',this,true);
-}this.validate();return;},validate:function(){if(this.disabled||(this.inputType=='radio'&&this.validateRadio())||(this.inputType=='checkbox'&&this.validateCheckbox())){this.markValid();return true;}this.markInvalid();return false;},validateRadio:function(){var A=false;
-Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){if(!e.dom.checked){return;}A=true;return false;});return A;},validateCheckbox:function(){if(!this.groupId){return (this.getValue()==this.inputValue||this.allowBlank)?true:false;
+}});var E=C;if(this.before||this.after){E={cls:'input-group',cn:[]};if(this.before){E.cn.push({tag:'span',cls:'input-group-addon',html:this.before});}E.cn.push(C);if(this.after){E.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}}if(A==='left'&&this.fieldLabel.length){B.cn=[{tag:'label','for':id,cls:'control-label col-md-'+this.labelWidth,html:this.fieldLabel}
+,{cls:"col-md-"+(12-this.labelWidth),cn:[E]}];}else if(this.fieldLabel.length){B.cn=[{tag:this.boxLabel?'span':'label','for':id,cls:'control-label box-input-label',html:this.fieldLabel},E];}else{B.cn=[E];}if(this.boxLabel){var F={tag:'label',cls:'box-label',html:this.boxLabel}
+;if(this.tooltip){F.tooltip=this.tooltip;}B.cn.push(F);}return B;},inputEl:function(){return this.el.select('input.roo-'+this.inputType,true).first();},labelEl:function(){return this.el.select('label.control-label',true).first();},label:function(){return this.labelEl();
+},initEvents:function(){this.inputEl().on('click',this.onClick,this);if(this.boxLabel){this.el.select('label.box-label',true).first().on('click',this.onClick,this);}this.startValue=this.getValue();if(this.groupId){Roo.bootstrap.CheckBox.register(this);}},onClick:function(){this.setChecked(!this.checked);
+},setChecked:function(A,B){this.startValue=this.getValue();if(this.inputType=='radio'){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){e.dom.checked=false;});this.inputEl().dom.checked=true;this.inputEl().dom.value=this.inputValue;
+if(B!==true){this.fireEvent('check',this,true);}this.validate();return;}this.checked=A;this.inputEl().dom.checked=A;this.inputEl().dom.value=A?this.inputValue:this.valueOff;if(B!==true){this.fireEvent('check',this,A);}this.validate();},getValue:function(){if(this.inputType=='radio'){return this.getGroupValue();
+}return this.inputEl().getValue();},getGroupValue:function(){if(typeof(this.el.up('form').child('input[name='+this.name+']:checked',true))=='undefined'){return '';}return this.el.up('form').child('input[name='+this.name+']:checked',true).value;},setValue:function(v,A){if(this.inputType=='radio'){this.setGroupValue(v,A);
+return;}this.setChecked(((typeof(v)=='undefined')?this.checked:(String(v)===String(this.inputValue))),A);this.validate();},setGroupValue:function(v,A){this.startValue=this.getValue();Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){e.dom.checked=false;
+if(e.dom.value==v){e.dom.checked=true;}});if(A!==true){this.fireEvent('check',this,true);}this.validate();return;},validate:function(){if(this.disabled||(this.inputType=='radio'&&this.validateRadio())||(this.inputType=='checkbox'&&this.validateCheckbox())){this.markValid();
+return true;}this.markInvalid();return false;},validateRadio:function(){var A=false;Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){if(!e.dom.checked){return;}A=true;return false;});return A;},validateCheckbox:function(){if(!this.groupId){return (this.getValue()==this.inputValue||this.allowBlank)?true:false;
 }var A=Roo.bootstrap.CheckBox.get(this.groupId);if(!A){return false;}var r=false;for(var i in A){if(r){break;}r=(A[i].getValue()==A[i].inputValue)?true:false;}return r;},markValid:function(){if(this.allowBlank){return;}var A=this;this.fireEvent('valid',this);
 var B=Roo.bootstrap.FieldLabel.get(this.name+'-group');if(this.groupId){B=Roo.bootstrap.FieldLabel.get(this.groupId+'-group');}if(B){B.markValid();}if(this.inputType=='radio'){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){e.findParent('.form-group',false,true).removeClass([A.invalidClass,A.validClass]);
 e.findParent('.form-group',false,true).addClass(A.validClass);});return;}if(!this.groupId){this.el.findParent('.form-group',false,true).removeClass([this.invalidClass,this.validClass]);this.el.findParent('.form-group',false,true).addClass(this.validClass);