From be88756a2b4015ad7095148af82fd8b914cdcd64 Mon Sep 17 00:00:00 2001 From: Edward Date: Fri, 15 Aug 2014 15:21:14 +0800 Subject: [PATCH] Roo/bootstrap/Button.js roojs-bootstrap.js roojs-bootstrap-debug.js --- Roo/bootstrap/Button.js | 4 ++-- roojs-bootstrap-debug.js | 4 ++-- roojs-bootstrap.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Roo/bootstrap/Button.js b/Roo/bootstrap/Button.js index 11219b0c9b..c20df0d339 100644 --- a/Roo/bootstrap/Button.js +++ b/Roo/bootstrap/Button.js @@ -82,7 +82,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { getAutoCreate : function(){ - Roo.log('getAutoCreate Roo.bootstrap Button~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1'); + var cfg = { tag : 'button', cls : 'roo-button', @@ -95,7 +95,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { } else { cfg.tag = this.tag; } - cfg.html = '
' + (this.html || cfg.html) + '
'; + cfg.html = '' + (this.html || cfg.html) + ''; if (this.toggle == true) { cfg={ diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index fd82469e59..8662a4c18a 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -472,7 +472,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { getAutoCreate : function(){ - Roo.log('getAutoCreate Roo.bootstrap Button~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1'); + var cfg = { tag : 'button', cls : 'roo-button', @@ -485,7 +485,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { } else { cfg.tag = this.tag; } - cfg.html = '
' + (this.html || cfg.html) + '
'; + cfg.html = '' + (this.html || cfg.html) + ''; if (this.toggle == true) { cfg={ diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 18cbc2ba8a..ab392790d8 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -11,8 +11,8 @@ Roo.bootstrap.Body=function(A){Roo.bootstrap.Body.superclass.constructor.call(th Roo.bootstrap.ButtonGroup=function(A){Roo.bootstrap.ButtonGroup.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.ButtonGroup,Roo.bootstrap.Component,{size:'',align:'',direction:'',toolbar:false,btn:true,getAutoCreate:function(){var A={cls:'btn-group',html:null} A.html=this.html||A.html;if(this.toolbar){A={cls:'btn-toolbar',html:null};return A;}if(['vertical','justified'].indexOf(this.align)!==-1){A.cls='btn-group-'+this.align;if(this.align=='justified'){console.log(this.items);}}if(['lg','sm','xs'].indexOf(this.size)!==-1){A.cls+=' btn-group-'+this.size;}if(this.direction=='up'){A.cls+=' dropup';}return A;}}); //Roo/bootstrap/Button.js -Roo.bootstrap.Button=function(A){Roo.bootstrap.Button.superclass.constructor.call(this,A);this.addEvents({"click":true,"toggle":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,removeClass:false,name:false,target:false,pressed:null,getAutoCreate:function(){Roo.log('getAutoCreate Roo.bootstrap Button~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1');var A={tag:'button',cls:'roo-button',html:''};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="×";return A;}if(this.theme==='default'){A.cls='btn roo-button';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';}if(this.disabled){A.disabled='disabled';}if(this.items){Roo.log('changing to ul');A.tag='ul';this.glyphicon='caret';} +Roo.bootstrap.Button=function(A){Roo.bootstrap.Button.superclass.constructor.call(this,A);this.addEvents({"click":true,"toggle":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,removeClass:false,name:false,target:false,pressed:null,getAutoCreate:function(){var A={tag:'button',cls:'roo-button',html:''};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="×";return A;}if(this.theme==='default'){A.cls='btn roo-button';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';}if(this.disabled){A.disabled='disabled';}if(this.items){Roo.log('changing to ul');A.tag='ul';this.glyphicon='caret';} A.cls+=this.size.length?(' btn-'+this.size):'';if(this.parentType==='Navbar'&&!this.parent().bar){Roo.log('changing to li?');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+' ';A.cls+=' dropdown';}delete A.html;} A.cls+=this.parentType==='Navbar'?' navbar-btn':'';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.href=this.href;var B=A.html;if(this.glyphicon){B={tag:'span',cls:'glyphicon glyphicon-'+this.glyphicon,html:this.html};} A.cn=[B,{tag:'span',cls:'badge',html:this.badge}];A.html='';}if(this.menu){A.cls+=' dropdown';A.html=typeof(A.html)!='undefined'?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;}if(this.removeClass){A.cls='';}if(this.target){A.target=this.target;}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);} -- 2.39.2