roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Thu, 17 Sep 2020 06:09:40 +0000 (14:09 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 17 Sep 2020 06:09:40 +0000 (14:09 +0800)
roojs-bootstrap-debug.js
examples/bootstrap/dashboard4.bjs
examples/bootstrap/dashboard4.js

examples/bootstrap/dashboard4.bjs
examples/bootstrap/dashboard4.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 4b89c0f..6c2c64d 100644 (file)
          "String header" : "ticket 1",
          "xtype" : "Card",
          "$ xns" : "Roo.bootstrap"
+        },
+        {
+         "String weight" : "primary",
+         "xtype" : "Button",
+         "$ xns" : "Roo.bootstrap"
         }
        ]
       }
index 444ad9b..d89ad36 100644 (file)
@@ -48,6 +48,12 @@ dashboard4 = new Roo.XComponent({
          header : _this._strings['d9fb0367346d21079a1c52d72da61c9f'] /* ticket 1 */,
          xns : Roo.bootstrap,
          '|xns' : 'Roo.bootstrap'
+        },
+        {
+         xtype : 'Button',
+         weight : 'primary',
+         xns : Roo.bootstrap,
+         '|xns' : 'Roo.bootstrap'
         }
        ]
       }
index 324d160..bbddd80 100644 (file)
@@ -1580,7 +1580,7 @@ Roo.extend(Roo.bootstrap.Card, Roo.bootstrap.Component,  {
     title : '',
     subtitle : '',
     html : '',
-    
+    footer: '',
     
     childContainer : false,
 
@@ -1675,7 +1675,7 @@ Roo.extend(Roo.bootstrap.Card, Roo.bootstrap.Component,  {
             cls : 'card-body',
             cn : []
         };
-        cfg.push(body);
+        cfg.cn.push(body);
         
         if (this.title.length) {
             body.cn.push({
@@ -1698,6 +1698,12 @@ Roo.extend(Roo.bootstrap.Card, Roo.bootstrap.Component,  {
             cls : 'roo-card-body-ctr'
         });
         
+        if (this.html.length) {
+            body.cn.push({
+                tag: 'div',
+                html : this.html
+            });
+        }
         // fixme ? handle objects?
         if (this.footer.length) {
             body.cn.push({
index a9da16f..a09e8e8 100644 (file)
@@ -60,13 +60,13 @@ return this.el.select('.panel-body',true).first()},titleEl:function(){if(!this.e
 },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 A='';
+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:'',footer:'',childContainer:false,layoutCls:function(){var A='';
 var t=this;['','top','bottom','left','right','x','y'].forEach(function(v){if(t['margin'+(v.length?'_':'')+v].length){A+=' m'+(v.length?v[0]:'')+'-'+t['margin'+(v.length?'_':'')+v];}if(t['padding'+(v.length?'_':'')+v].length){A+=' p'+(v.length?v[0]:'')+'-'+t['padding'+(v.length?'_':'')+v];
 }});['','xs','sm','lg','xl'].forEach(function(v){if(t['display'+(v.length?'_':'')+v].length){A+=' d'+(v.length?'-':'')+v+'-'+t['margin'+(v.length?'_':'')+v].length}});if(this.hidden){A+=' d-none';}return A;},getAutoCreate:function(){var A={tag:'div',cls:'card',cn:[]}
 ;if(this.weight.length&&this.weight!='light'){A.cls+=' text-white'}if(this.weight.length){A.cls+=' bg-'+this.weight;}A.cls+=this.layoutCls();if(this.header.length){A.cn.push({tag:this.header_size>0?'h'+this.header_size:'div',cls:'card-header',html:this.header}
-);}if(this.header_image.length){A.cn.push({tag:'img',cls:'card-img-top',src:this.header_image});}var B={tag:'div',cls:'card-body',cn:[]};A.push(B);if(this.title.length){B.cn.push({tag:'div',cls:'card-title',src:this.title});}if(this.subtitle.length){B.cn.push({tag:'div',cls:'card-title',src:this.subtitle}
-);}B.cn.push({tag:'div',cls:'roo-card-body-ctr'});if(this.footer.length){B.cn.push({tag:'div',cls:'card-footer',html:this.footer});}return A;},getChildContainer:function(){if(!this.el){return false;}return this.el.select('.roo-card-body-ctr',true).first();
-}});
+);}if(this.header_image.length){A.cn.push({tag:'img',cls:'card-img-top',src:this.header_image});}var B={tag:'div',cls:'card-body',cn:[]};A.cn.push(B);if(this.title.length){B.cn.push({tag:'div',cls:'card-title',src:this.title});}if(this.subtitle.length){B.cn.push({tag:'div',cls:'card-title',src:this.subtitle}
+);}B.cn.push({tag:'div',cls:'roo-card-body-ctr'});if(this.html.length){B.cn.push({tag:'div',html:this.html});}if(this.footer.length){B.cn.push({tag:'div',cls:'card-footer',html:this.footer});}return A;},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;