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

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

index 879521e..e5ab446 100644 (file)
@@ -73,8 +73,9 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
         var fieldLabel = {
             tag: 'label' ,
             cls : 'control-label' + inline,
-            html : this.fieldLabel
-        }
+            html : this.fieldLabel,
+            style : 'cursor:pointer'
+        };
         
  
         
index 222be4a..c86067a 100644 (file)
@@ -16485,8 +16485,9 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
         var fieldLabel = {
             tag: 'label' ,
             cls : 'control-label' + inline,
-            html : this.fieldLabel
-        }
+            html : this.fieldLabel,
+            style : 'cursor:pointer'
+        };
         
  
         
@@ -16581,6 +16582,18 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
         return cfg;
         
     },
+    
+    initEvents : function()
+    {
+//        Roo.bootstrap.CheckBox.superclass.initEvents.call(this);
+        
+        this.inputEl().on('click', this.onClick,  this);
+        if (this.boxLabel) { 
+            this.el.select('label.box-label',true).first().on('click', this.onClick,  this);
+        }
+        
+    },
+    
     inputEl: function ()
     {
         return this.el.select('input.roo-radio',true).first();
index 4dddbdf..f669367 100644 (file)
@@ -365,9 +365,9 @@ 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',cls:'',cn:[]};var C=this.inline?' radio-inline':'';var D={tag:'label','for':id,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);}
-D.cn.push(G);B.cn.push({tag:'span',cls:'radio'+C,cn:[D]});if(this.boxLabel){D.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;});}
+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',cls:'',cn:[]};var C=this.inline?' radio-inline':'';var D={tag:'label','for':id,cls:'control-label box-label'+C,cn:[]};var E={tag:'label',cls:'control-label'+C,html:this.fieldLabel,style:'cursor:pointer'};var F={tag:'input',id:id,type:this.inputType,value:this.inputValue,cls:'roo-radio',placeholder:this.placeholder||''};if(this.weight){F.cls+=" radio-"+this.weight;}if(this.disabled){F.disabled=true;}if(this.checked){F.checked=this.checked;}if(this.name){F.name=this.name;}if(this.size){F.cls+=' input-'+this.size;}var G=this;['xs','sm','md','lg'].map(function(I){if(G[I]){B.cls+=' col-'+I+'-'+G[I];}});var H=F;if(this.before||this.after){H={cls:'input-group',tag:'span',cn:[]};if(this.before){H.cn.push({tag:'span',cls:'input-group-addon',html:this.before});}
+H.cn.push(F);if(this.after){H.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}};if(this.fieldLabel&&this.fieldLabel.length){B.cn.push(E);}
+D.cn.push(H);B.cn.push({tag:'span',cls:'radio'+C,cn:[D]});if(this.boxLabel){D.cn.push({tag:'span',html:this.boxLabel})}return B;},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);}},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 {}