Roo/bootstrap/Button.js
authorEdward <edward@roojs.com>
Mon, 31 Mar 2014 10:51:26 +0000 (18:51 +0800)
committerEdward <edward@roojs.com>
Mon, 31 Mar 2014 10:51:26 +0000 (18:51 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

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

index 861adc5..a2267f9 100644 (file)
@@ -213,7 +213,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
                 }
             ];
             
-            cfg.html='';
+//            cfg.html='';
         }
         
         if (cfg.tag !== 'a' && this.href !== '') {
index 313ab8e..3a4c1ef 100644 (file)
@@ -560,8 +560,8 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
             cfg.cn = [
                 {
                     tag: 'span',
-                    cls: 'glyphicon glyphicon-' + this.glyphicon,
-                    html: this.html
+                    cls: 'glyphicon glyphicon-' + this.glyphicon
+                    
                 },
                 {
                     tag: 'span',
@@ -570,7 +570,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
                 }
             ];
             
-            cfg.html='';
+//            cfg.html='';
         }
         
         if (cfg.tag !== 'a' && this.href !== '') {
index 3a89dbb..ac11cb3 100644 (file)
@@ -12,7 +12,7 @@ A.html=this.html||A.html;if(this.toolbar){A={cls:'btn-toolbar',html:null};return
 //Roo/bootstrap/Button.js
 Roo.bootstrap.Button=function(A){Roo.bootstrap.Button.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.Button,Roo.bootstrap.Component,{html:false,active:false,weight:'',size:'',tag:'button',href:'',disabled:false,isClose:false,glyphicon:'',badge:'',theme:'default',inverse:false,toggle:false,ontext:'ON',offtext:'OFF',defaulton:true,preventDefault:true,getAutoCreate:function(){var A={tag:'button',cls:'roo-button',html:'hello'};if(['a','button','input','submit'].indexOf(this.tag)<0){throw "Invalid value for tag: "+this.tag+". must be a, button, input or submit.";this.tag='button';}else {A.tag=this.tag;}
 A.html=this.html||A.html;if(this.toggle===true){A={tag:'div',cls:'slider-frame roo-button',cn:[{tag:'span','data-on-text':'ON','data-off-text':'OFF',cls:'slider-button',html:this.offtext}]};if(['default','primary','success','info','warning','danger','link'].indexOf(this.weight)>-1){A.cls+=' '+this.weight;}return A;}if(this.isClose){A.cls+=' close';A["aria-hidden"]=true;A.html="&times;";return A;}if(this.theme==='default'){A.cls='btn roo-button';if(this.parentType!='Navbar'){this.weight=this.weight.length?this.weight:'default';}if(['default','primary','success','info','warning','danger','link'].indexOf(this.weight)>-1){A.cls+=' btn-'+this.weight;}}else if(this.theme==='glow'){A.tag='a';A.cls='btn-glow roo-button';if(['default','primary','success','info','warning','danger','link'].indexOf(this.weight)>-1){A.cls+=' '+this.weight;}}if(this.inverse){this.cls+=' inverse';}if(this.active){A.cls+=' active';}
-A.cls+=this.size.length?(' btn-'+this.size):'';if(this.parentType==='Navbar'){A.tag='li';A.cls='';A.cn=[{tag:'a',cls:'roo-button',html:this.html,href:this.href||'#'}];if(this.menu){A.cn[0].html=this.html+' <span class="caret"></span>';A.cls+=' dropdown';}delete A.html;}else if(this.menu){A.tag='a';A.cls+=' dropdown test';}if(this.disabled){A.disabled='disabled';}if(this.items){Roo.log('changing to ul');A.tag='ul';this.glyphicon='caret';}if(this.glyphicon){A.html=' '+A.html;A.cn=[{tag:'span',cls:'glyphicon glyphicon-'+this.glyphicon}];}if(this.badge){A.html+=' ';A.tag='a';A.cls='btn roo-button';A.href=this.href;A.cn=[{tag:'span',cls:'glyphicon glyphicon-'+this.glyphicon,html:this.html},{tag:'span',cls:'badge',html:this.badge}];A.html='';}if(A.tag!=='a'&&this.href!==''){throw "Tag must be a to set href.";}else if(this.href.length>0){A.href=this.href;}return A;},initEvents:function(){if(this.el.hasClass('roo-button')){this.el.on('click',this.onClick,this);}else {this.el.select('.roo-button').on('click',this.onClick,this);}},onClick:function(e){Roo.log('button on click ');if(this.preventDefault){e.preventDefault();}
+A.cls+=this.size.length?(' btn-'+this.size):'';if(this.parentType==='Navbar'){A.tag='li';A.cls='';A.cn=[{tag:'a',cls:'roo-button',html:this.html,href:this.href||'#'}];if(this.menu){A.cn[0].html=this.html+' <span class="caret"></span>';A.cls+=' dropdown';}delete A.html;}else if(this.menu){A.tag='a';A.cls+=' dropdown test';}if(this.disabled){A.disabled='disabled';}if(this.items){Roo.log('changing to ul');A.tag='ul';this.glyphicon='caret';}if(this.glyphicon){A.html=' '+A.html;A.cn=[{tag:'span',cls:'glyphicon glyphicon-'+this.glyphicon}];}if(this.badge){A.html+=' ';A.tag='a';A.cls='btn roo-button';A.href=this.href;A.cn=[{tag:'span',cls:'glyphicon glyphicon-'+this.glyphicon},{tag:'span',cls:'badge',html:this.badge}];}if(A.tag!=='a'&&this.href!==''){throw "Tag must be a to set href.";}else if(this.href.length>0){A.href=this.href;}return A;},initEvents:function(){if(this.el.hasClass('roo-button')){this.el.on('click',this.onClick,this);}else {this.el.select('.roo-button').on('click',this.onClick,this);}},onClick:function(e){Roo.log('button on click ');if(this.preventDefault){e.preventDefault();}
 this.fireEvent('click',this,e);}});
 //Roo/bootstrap/Column.js
 Roo.bootstrap.Column=function(A){Roo.bootstrap.Column.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Column,Roo.bootstrap.Component,{xs:null,sm:null,md:null,lg:null,html:'',offset:0,getAutoCreate:function(){var A=Roo.apply({},Roo.bootstrap.Column.superclass.getAutoCreate.call(this));A={tag:'div',cls:'column'};var B=this;['xs','sm','md','lg'].map(function(C){if(B[C]){A.cls+=' col-'+C+'-'+B[C];}});if(this.html.length){A.html=this.html;}return A;}});