Roo/bootstrap/Radio.js
authorAlan Knowles <alan@roojs.com>
Thu, 30 Jul 2015 07:01:25 +0000 (15:01 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 30 Jul 2015 07:01:25 +0000 (15:01 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

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

index e189846..26f8990 100644 (file)
@@ -64,7 +64,7 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
         var lbl = {
                 tag: 'label' ,
                 // does not need for, as we wrap the input with it..
-                cls : 'control-label ' + inline,
+                cls : 'control-label box-label' + inline,
                 cn : []
         };
         
index ca06ddf..ecc2edb 100644 (file)
@@ -16476,7 +16476,7 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
         var lbl = {
                 tag: 'label' ,
                 // does not need for, as we wrap the input with it..
-                cls : 'control-label ' + inline,
+                cls : 'control-label box-label' + inline,
                 cn : []
         };
         
index b97553a..b7c35e9 100644 (file)
@@ -365,7 +365,7 @@ this.checked=A;if(B!==true){this.fireEvent('check',this,A);}
 this.inputEl().dom.checked=A;this.inputEl().dom.value=A?this.inputValue:this.valueOff;},getValue:function(){if(this.inputType=='radio'){return this.getGroupValue();}return this.inputEl().getValue();},getGroupValue:function(){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);},setGroupValue:function(v,A){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);}return;}});
 //Roo/bootstrap/Radio.js
-Roo.bootstrap.Radio=function(A){Roo.bootstrap.Radio.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Radio,Roo.bootstrap.CheckBox,{inputType:'radio',inputValue:'',valueOff:'',getAutoCreate:function(){var A=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign;A=A||'left';var id=Roo.id();var B={tag:this.inline?'span':'div',cn:[]};var C=this.inline?' radio-inline':'';var D={tag:'label',cls:'control-label '+C,cn:[]};var E={tag:'label',cls:'control-label'+C,html:this.fieldLabel};var input={tag:'input',id:id,type:this.inputType,value:this.inputValue,cls:'roo-radio',placeholder:this.placeholder||''};if(this.weight){input.cls+=" radio-"+this.weight;}if(this.disabled){input.disabled=true;}if(this.checked){input.checked=this.checked;}if(this.name){input.name=this.name;}if(this.size){input.cls+=' input-'+this.size;}var F=this;['xs','sm','md','lg'].map(function(H){if(F[H]){B.cls+=' col-'+H+'-'+F[H];}});var G=input;if(this.before||this.after){G={cls:'input-group',tag:'span',cn:[]};if(this.before){G.cn.push({tag:'span',cls:'input-group-addon',html:this.before});}
+Roo.bootstrap.Radio=function(A){Roo.bootstrap.Radio.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Radio,Roo.bootstrap.CheckBox,{inputType:'radio',inputValue:'',valueOff:'',getAutoCreate:function(){var A=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign;A=A||'left';var id=Roo.id();var B={tag:this.inline?'span':'div',cn:[]};var C=this.inline?' radio-inline':'';var D={tag:'label',cls:'control-label box-label'+C,cn:[]};var E={tag:'label',cls:'control-label'+C,html:this.fieldLabel};var input={tag:'input',id:id,type:this.inputType,value:this.inputValue,cls:'roo-radio',placeholder:this.placeholder||''};if(this.weight){input.cls+=" radio-"+this.weight;}if(this.disabled){input.disabled=true;}if(this.checked){input.checked=this.checked;}if(this.name){input.name=this.name;}if(this.size){input.cls+=' input-'+this.size;}var F=this;['xs','sm','md','lg'].map(function(H){if(F[H]){B.cls+=' col-'+H+'-'+F[H];}});var G=input;if(this.before||this.after){G={cls:'input-group',tag:'span',cn:[]};if(this.before){G.cn.push({tag:'span',cls:'input-group-addon',html:this.before});}
 G.cn.push(input);if(this.after){G.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}};if(this.fieldLabel&&this.fieldLabel.length){B.cn.push(E);}
 B.cn.push(D);D.cn.push(G);if(this.boxLabel){B.cn.push({tag:'span',html:this.boxLabel})}return B;},inputEl:function(){return this.el.select('input.roo-radio',true).first();},onClick:function(){Roo.log("click");Roo.log("click");this.setChecked(true);},setChecked:function(A,B){if(A){Roo.each(this.inputEl().up('form').select('input[name='+this.inputEl().dom.name+']',true).elements,function(v){v.dom.checked=false;});}
 this.checked=A;this.inputEl().dom.checked=A;if(B!==true){this.fireEvent('check',this,A);}},getGroupValue:function(){var A=''Roo.each(this.inputEl().up('form').select('input[name='+this.inputEl().dom.name+']',true).elements,function(v){if(v.dom.checked==true){A=v.dom.value;}});return A;},getValue:function(){return this.getGroupValue();}});