2 * This is BS4's Card element.. - similar to our containers probably..
6 * @class Roo.bootstrap.Card
7 * @extends Roo.bootstrap.Component
11 * possible... may not be implemented..
12 * @cfg {String} header content of header (for panel)
13 * @cfg {String|Object} - title
14 * @cfg {String|Object} - subtitle
15 * @cfg {String|Object} - body
16 * @cfg {String|Object} - footer
17 * @cfg {Array} - links
20 * Create a new Container
21 * @param {Object} config The config object
24 Roo.bootstrap.Card = function(config){
25 Roo.bootstrap.Card.superclass.constructor.call(this, config);
33 Roo.extend(Roo.bootstrap.Card, Roo.bootstrap.Component, {
37 // Roo.log("Call onRender: " + this.xtype);
38 /* We are looking at something like this.
40 <img src="..." class="card-img-top" alt="...">
41 <div class="card-body">
42 <h5 class="card-title">Card title</h5>
43 <h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
45 >> this bit is really the body...
46 <div> << we will ad dthis in hopefully it will not break shit.
48 <p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
51 <a href="#" class="card-link">Card link</a>
54 <div class="card-footer">
55 <small class="text-muted">Last updated 3 mins ago</small>
59 getAutoCreate : function(){
62 tag : this.tag || 'div',
67 cfg.cls = 'jumbotron';
72 // - this is applied by the parent..
74 // cfg.cls = this.cls + '';
77 if (this.sticky.length) {
79 var bd = Roo.get(document.body);
80 if (!bd.hasClass('bootstrap-sticky')) {
81 bd.addClass('bootstrap-sticky');
82 Roo.select('html',true).setStyle('height', '100%');
85 cfg.cls += 'bootstrap-sticky-' + this.sticky;
89 if (this.well.length) {
93 cfg.cls +=' well well-' +this.well;
102 cfg.cls += ' hidden';
106 if (this.alert && ["success","info","warning", "danger"].indexOf(this.alert) > -1) {
107 cfg.cls +=' alert alert-' + this.alert;
112 if (this.panel.length) {
113 cfg.cls += ' panel panel-' + this.panel;
115 if (this.header.length) {
121 cfg.cls = cfg.cls + ' expandable';
125 cls: (this.expanded ? 'fa fa-minus' : 'fa fa-plus')
134 html : (this.expandable ? ' ' : '') + this.header
138 cls: 'panel-header-right',
144 cls : 'panel-heading',
145 style : this.expandable ? 'cursor: pointer' : '',
153 cls : 'panel-body' + (this.expanded ? '' : ' hide'),
158 if (this.footer.length) {
160 cls : 'panel-footer',
169 body.html = this.html || cfg.html;
170 // prefix with the icons..
172 body.html = '<i class="fa fa-'+this.fa + '"></i>' + body.html ;
175 body.html = '<i class="glyphicon glyphicon-'+this.icon + '"></i>' + body.html ;
180 if ((!this.cls || !this.cls.length) && (!cfg.cls || !cfg.cls.length)) {
181 cfg.cls = 'container';