compile card into bootstrap
[roojs1] / roojs-bootstrap.js
index 80349e1..aa5b353 100644 (file)
@@ -59,6 +59,14 @@ return;}this.expand();},expand:function(){if(this.fireEvent('expand',this)){this
 return this.el.select('.panel-body',true).first()},titleEl:function(){if(!this.el||!this.panel.length||!this.header.length){return;}return this.el.select('.panel-title',true).first();},setTitle:function(v){var A=this.titleEl();if(!A){return;}A.dom.innerHTML=v;
 },getTitle:function(){var A=this.titleEl();if(!A){return '';}return A.dom.innerHTML;},setRightTitle:function(v){var t=this.el.select('.panel-header-right',true).first();if(!t){return;}t.dom.innerHTML=v;},onClick:function(e){e.preventDefault();this.fireEvent('click',this,e);
 }});
+// Roo/bootstrap/Card.js
+Roo.bootstrap.Card=function(A){Roo.bootstrap.Card.superclass.constructor.call(this,A);this.addEvents({});};Roo.extend(Roo.bootstrap.Card,Roo.bootstrap.Component,{weight:'',margin:'',margin_top:'',margin_bottom:'',margin_left:'',margin_right:'',margin_x:'',margin_y:'',padding:'',padding_top:'',padding_bottom:'',padding_left:'',padding_right:'',padding_x:'',padding_y:'',display:'',display_xs:'',display_sm:'',display_lg:'',display_xl:'',header_image:'',header:'',header_size:0,title:'',subtitle:'',html:'',childContainer:false,layoutCls:function(){var cls='';
+var t=this;['','top','bottom','left','right','x','y'].forEach(function(v){if(t['margin'+(v.length?'_':'')+v].length){cls+=' m'+(v.length?v[0]:'')+'-'+t['margin'+(v.length?'_':'')+v];}if(t['padding'+(v.length?'_':'')+v].length){cls+=' p'+(v.length?v[0]:'')+'-'+t['padding'+(v.length?'_':'')+v];
+}});['','xs','sm','lg','xl'].forEach(function(v){if(t['display'+(v.length?'_':'')+v].length){cls+=' d'+(v.length?'-':'')+v+'-'+t['margin'+(v.length?'_':'')+v].length}});if(this.hidden){cls+=' d-none';}return cls;},getAutoCreate:function(){var cfg={tag:'div',cls:'card',cn:[]}
+;if(this.weight.length&&this.weight!='light'){cfg.cls+=' text-white'}if(this.weight.length){cfg.cls+=' bg-'+this.weight;}cfg.cls+=this.layoutCls();if(this.header.length){cfg.cn.push({tag:this.header_size>0?'h'+this.header_size:'div',cls:'card-header',html:this.header}
+);}if(this.header_image.length){cfg.cn.push({tag:'img',cls:'card-img-top',src:this.header_image});}var body={tag:'div',cls:'card-body',cn:[]};cfg.push(body);if(this.title.length){body.cn.push({tag:'div',cls:'card-title',src:this.title});}if(this.subtitle.length){body.cn.push({tag:'div',cls:'card-title',src:this.subtitle}
+);}body.cn.push({tag:'div',cls:'roo-card-body-ctr'});if(this.footer.length){body.cn.push({tag:'div',cls:'card-footer',html:this.footer});}return cfg;},getChildContainer:function(){if(!this.el){return false;}return this.el.select('.roo-card-body-ctr',true).first();
+}}
 // Roo/bootstrap/Img.js
 Roo.bootstrap.Img=function(A){Roo.bootstrap.Img.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.Img,Roo.bootstrap.Component,{imgResponsive:true,border:'',src:'about:blank',href:false,target:false,xsUrl:'',smUrl:'',mdUrl:'',lgUrl:'',getAutoCreate:function(){if(this.src||(!this.xsUrl&&!this.smUrl&&!this.mdUrl&&!this.lgUrl)){return this.createSingleImg();
 }var A={tag:'div',cls:'roo-image-responsive-group',cn:[]};var B=this;Roo.each(['xs','sm','md','lg'],function(C){if(!B[C+'Url']){return;}var D={tag:'img',cls:(B.imgResponsive)?'img-responsive':'',html:B.html||A.html,src:B[C+'Url']};D.cls+=' roo-image-responsive-'+C;