Roo/bootstrap/Card.js
[roojs1] / Roo / bootstrap / Card.js
index d5144a6..6364b49 100644 (file)
@@ -91,7 +91,7 @@ Roo.extend(Roo.bootstrap.Card, Roo.bootstrap.Component,  {
     title : '',
     subtitle : '',
     html : '',
-    
+    footer: '',
     
     childContainer : false,
 
@@ -99,20 +99,20 @@ Roo.extend(Roo.bootstrap.Card, Roo.bootstrap.Component,  {
     {
         var cls = '';
         var t = this;
-        
+        Roo.log(this.margin_bottom.length);
         ['', 'top', 'bottom', 'left', 'right', 'x', 'y' ].forEach(function(v) {
             // in theory these can do margin_top : ml-xs-3 ??? but we don't support that yet
             
-            if (t['margin' + (v.length ? '_' : '') + v].length) {
+            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) {
+            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) {
+        ['', '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
             }
         });
@@ -186,7 +186,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({
@@ -209,6 +209,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({
@@ -232,4 +238,5 @@ Roo.extend(Roo.bootstrap.Card, Roo.bootstrap.Component,  {
         return this.el.select('.roo-card-body-ctr',true).first();    
     }
     
-}
\ No newline at end of file
+});
+