Roo/bootstrap/CheckBox.js
authorEdward <edward@roojs.com>
Fri, 13 Jun 2014 04:32:20 +0000 (12:32 +0800)
committerEdward <edward@roojs.com>
Fri, 13 Jun 2014 04:32:20 +0000 (12:32 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

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

index e07b1c3..f98091a 100644 (file)
@@ -209,6 +209,7 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
     
     setValue : function(v,suppressEvent)
     {
+        Roo.log('run set value on checkbox?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
         this.setChecked(String(v) === String(this.inputValue), suppressEvent);
     }
     
index d9807fa..00b1675 100644 (file)
@@ -12562,11 +12562,7 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
     {
         this.checked = state;
         
-        this.inputEl().attr('checked', true)
-        
-        if(!state){
-            this.inputEl().dom.removeAttribute('checked');
-        }
+        this.inputEl().dom.checked = state;
         
         if(suppressEvent !== true){
             this.fireEvent('check', this, state);
@@ -12578,6 +12574,7 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
     
     setValue : function(v,suppressEvent)
     {
+        Roo.log('run set value on checkbox?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
         this.setChecked(String(v) === String(this.inputValue), suppressEvent);
     }
     
index 2a8728a..ddfe78d 100644 (file)
@@ -280,8 +280,8 @@ this.pop.select('.timepicker-hour',true).first().dom.innerHTML=A;this.pop.select
 this.picker().addClass('bottom');this.picker().setTop(this.inputEl().getHeight()).setLeft(this.inputEl().getLeft()-this.el.getLeft());},onFocus:function(){Roo.bootstrap.TimeField.superclass.onFocus.call(this);this.show();},onBlur:function(){Roo.bootstrap.TimeField.superclass.onBlur.call(this);this.hide();},show:function(){this.picker().show();this.pop.show();this.update();this.place();this.fireEvent('show',this,this.date);},hide:function(){this.picker().hide();this.pop.hide();this.fireEvent('hide',this,this.date);},setTime:function(){this.hide();this.setValue(this.time.format(this.format));this.fireEvent('select',this,this.date);},onMousedown:function(e){e.stopPropagation();e.preventDefault();},onIncrementHours:function(){Roo.log('onIncrementHours');this.time=this.time.add(Date.HOUR,1);this.update();},onDecrementHours:function(){Roo.log('onDecrementHours');this.time=this.time.add(Date.HOUR,-1);this.update();},onIncrementMinutes:function(){Roo.log('onIncrementMinutes');this.time=this.time.add(Date.MINUTE,1);this.update();},onDecrementMinutes:function(){Roo.log('onDecrementMinutes');this.time=this.time.add(Date.MINUTE,-1);this.update();},onTogglePeriod:function(){Roo.log('onTogglePeriod');this.time=this.time.add(Date.HOUR,12);this.update();}});Roo.apply(Roo.bootstrap.TimeField,{content:{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'}]}]},footer:{tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'th',colspan:'7',cls:'',cn:[{tag:'button',cls:'btn btn-info ok',html:'OK'}]}]}]}});Roo.apply(Roo.bootstrap.TimeField,{template:{tag:'div',cls:'datepicker dropdown-menu',cn:[{tag:'div',cls:'datepicker-time',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.TimeField.content,Roo.bootstrap.TimeField.footer]}]}]}});
 //Roo/bootstrap/CheckBox.js
 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,getAutoCreate:function(){var A=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign;var id=Roo.id();var B={};B.cls='form-group'var C={tag:'input',id:id,type:this.inputType,value:(!this.checked)?this.valueOff:this.inputValue,cls:'form-box',placeholder:this.placeholder||''};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(F){if(D[F]){B.cls+=' col-'+F+'-'+D[F];}});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){B.cn.push({tag:'label','for':id,cls:'box-label',html:this.boxLabel})}return B;},inputEl:function(){return this.el.select('input.form-box',true).first();},initEvents:function(){this.inputEl().on('click',this.onClick,this);},onClick:function(){this.setChecked(!this.checked);},setChecked:function(A,B){this.checked=A;this.inputEl().attr('checked',true)if(!A){this.inputEl().dom.removeAttribute('checked');}if(B!==true){this.fireEvent('check',this,A);}
-this.inputEl().dom.value=A?this.inputValue:this.valueOff;},setValue:function(v,A){this.setChecked(String(v)===String(this.inputValue),A);}});
+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){B.cn.push({tag:'label','for':id,cls:'box-label',html:this.boxLabel})}return B;},inputEl:function(){return this.el.select('input.form-box',true).first();},initEvents:function(){this.inputEl().on('click',this.onClick,this);},onClick:function(){this.setChecked(!this.checked);},setChecked:function(A,B){this.checked=A;this.inputEl().dom.checked=A;if(B!==true){this.fireEvent('check',this,A);}
+this.inputEl().dom.value=A?this.inputValue:this.valueOff;},setValue:function(v,A){Roo.log('run set value on checkbox?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');this.setChecked(String(v)===String(this.inputValue),A);}});
 //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;var id=Roo.id();var B={};B.cls='form-group'var C={tag:'input',id:id,type:this.inputType,value:(!this.checked)?this.valueOff:this.inputValue,cls:'form-box',placeholder:this.placeholder||''};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(F){if(D[F]){B.cls+=' col-'+F+'-'+D[F];}});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:'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){B.cn.push({tag:'label','for':id,cls:'box-label',html:this.boxLabel})}return B;},onClick:function(){this.setChecked(true);},setChecked:function(A,B){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);}