X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=Roo%2Fbootstrap%2FCard.js;fp=Roo%2Fbootstrap%2FCard.js;h=2cf1c9eb9e843be8dbefa7b6575f60df38c368ba;hp=b5560ffaa02dde9d2e22e584b3f1ff7a437508f9;hb=4806a3a6a72a6fc861a138965a6b1b5df60d0c87;hpb=bcc05f004771488d31e56e450a82aa3745a0af23 diff --git a/Roo/bootstrap/Card.js b/Roo/bootstrap/Card.js index b5560ffaa0..2cf1c9eb9e 100644 --- a/Roo/bootstrap/Card.js +++ b/Roo/bootstrap/Card.js @@ -12,7 +12,7 @@ * * possible... may not be implemented.. * @cfg {String} header_image src url of image. - * @cfg {String} header + * @cfg {String|Object} header * @cfg {Number} header_size (0|1|2|3|4|5) H1 or H2 etc.. 0 indicates default * * @cfg {String} title @@ -181,14 +181,24 @@ Roo.extend(Roo.bootstrap.Card, Roo.bootstrap.Component, { cls : 'card-header', html : this.header // escape? }); - } + } else { + cfg.cn.push({ + tag : 'div', + cls : 'card-header d-none' + }); + } if (this.header_image.length) { cfg.cn.push({ tag : 'img', cls : 'card-img-top', src: this.header_image // escape? }); - } + } else { + cfg.cn.push({ + tag : 'div', + cls : 'card-img-top d-none' + }); + } var body = { tag : 'div', @@ -238,6 +248,26 @@ Roo.extend(Roo.bootstrap.Card, Roo.bootstrap.Component, { }, + getCardHeader : function() + { + var ret = this.el.select('.card-header',true).first(); + if (ret.hasClass('d-none')) { + ret.removeClass('d-none'); + } + + return ret; + }, + + getCardImageTop : function() + { + var ret = this.el.select('.card-img-top',true).first(); + if (ret.hasClass('d-none')) { + ret.removeClass('d-none'); + } + + return ret; + }, + getChildContainer : function() {