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

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

index 658fc02..0fb997c 100644 (file)
@@ -32,6 +32,7 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
         align = align || 'left'; // default...
         
         
+        
         var id = Roo.id();
         
         var cfg = {};
@@ -110,11 +111,13 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
                 tag: 'label' ,
                 'for' :  id,
                 cls : 'control-label',
-                style :  'width: ' + (this.labelWidth *1) +'px',
+            
                 html : this.fieldLabel
                 
         };
         if (this.boxLabel) {
+            this.labelWidth = this.labelWidth  || 100;
+            lbl.style =  'width: ' + (this.labelWidth *1) +'px';
             lbl.tag = 'span';
             
         }
@@ -139,7 +142,7 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
         } else if ( this.fieldLabel.length) {
                 Roo.log(" label");
                 lbl.cls = '';
-                lbl.style  = '';
+                
                  cfg.cn = [  lbl,    inputblock ];
 
         } else {
index ca857bd..f7fc2e8 100644 (file)
@@ -16444,6 +16444,7 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
         align = align || 'left'; // default...
         
         
+        
         var id = Roo.id();
         
         var cfg = {};
@@ -16522,11 +16523,13 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
                 tag: 'label' ,
                 'for' :  id,
                 cls : 'control-label',
-                style :  'width: ' + (this.labelWidth *1) +'px',
+            
                 html : this.fieldLabel
                 
         };
         if (this.boxLabel) {
+            this.labelWidth = this.labelWidth  || 100;
+            lbl.style =  'width: ' + (this.labelWidth *1) +'px';
             lbl.tag = 'span';
             
         }
@@ -16551,7 +16554,7 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
         } else if ( this.fieldLabel.length) {
                 Roo.log(" label");
                 lbl.cls = '';
-                lbl.style  = '';
+                
                  cfg.cn = [  lbl,    inputblock ];
 
         } else {
index d674d19..8c7a3a9 100644 (file)
@@ -366,7 +366,7 @@ this.inputEl().dom.checked=A;this.inputEl().dom.value=A?this.inputValue:this.val
 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={};B.cls='form-group radio'if(this.inline){B.cls+=" radio-inline";}var C={tag:'input',id:id,type:this.inputType,value:this.inputValue,cls:'roo-radio',placeholder:this.placeholder||''};if(this.weight){B.cls+=" radio-"+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',tag:'span',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});}};var F={tag:'label','for':id,cls:'control-label',style:'width: '+(this.labelWidth*1)+'px',html:this.fieldLabel};if(this.boxLabel){F.tag='span';}if(A==='left'&&this.fieldLabel.length){Roo.log("left and has label");B.cn=[F,{tag:'span',cn:[E]}];}else if(this.fieldLabel.length){Roo.log(" label");F.cls='';F.style='';B.cn=[F,E];}else {Roo.log(" no label && no align");B.cn=[E];};if(this.boxLabel){B.cn.push({tag:'label','for':id,cls:'box-label',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;});}
+E.cn.push(C);if(this.after){E.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}};var F={tag:'label','for':id,cls:'control-label',html:this.fieldLabel};if(this.boxLabel){this.labelWidth=this.labelWidth||100;F.style='width: '+(this.labelWidth*1)+'px';F.tag='span';}if(A==='left'&&this.fieldLabel.length){Roo.log("left and has label");B.cn=[F,{tag:'span',cn:[E]}];}else if(this.fieldLabel.length){Roo.log(" label");F.cls='';B.cn=[F,E];}else {Roo.log(" no label && no align");B.cn=[E];};if(this.boxLabel){B.cn.push({tag:'label','for':id,cls:'box-label',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();}});
 //Roo/HtmlEditorCore.js
 Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resizable:false,height:300,width:500,stylesheets:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,getDocMarkup:function(){var st='';if(this.stylesheets===false){Roo.get(document.head).select('style').each(function(A){st+=A.dom.outerHTML||new XMLSerializer().serializeToString(A.dom);});Roo.get(document.head).select('link').each(function(A){st+=A.dom.outerHTML||new XMLSerializer().serializeToString(A.dom);});}else if(!this.stylesheets.length){st='<style type="text/css">'+'body{border:0;margin:0;padding:3px;height:98%;cursor:text;}'+'</style>';}else {}