* @cfg {Boolean} loadOnce When used with {@link #url}, calls {@link #setUrl} with this value
* @cfg {String} content Raw content to fill content panel with (uses setContent on construction.)
* @cfg {Boolean} badges render the badges
+ * @cfg {String} cls extra classes to use
+ * @cfg {String} background (primary|secondary|success|info|warning|danger|light|dark)
* @constructor
* Create a new ContentPanel.
this.el = Roo.DomHelper.append(document.body,
config.autoCreate, true);
}else{
- var elcfg = { tag: "div",
- cls: "roo-layout-inactive-content",
- id: config.id||el
- };
+ var elcfg = {
+ tag: "div",
+ cls: (config.cls || '') +
+ (config.background ? ' bg-' + config.background : '') +
+ " roo-layout-inactive-content",
+ id: config.id||el
+ };
if (config.html) {
elcfg.html = config.html;
Roo.extend(Roo.bootstrap.panel.Content, Roo.bootstrap.Component, {
+ cls : '',
+ background : '',
+
tabTip : '',
setRegion : function(region){
this.active = active;
this.setActiveClass(active);
if(!active){
- this.fireEvent("deactivate", this);
- }else{
- this.fireEvent("activate", this);
+ if(this.fireEvent("deactivate", this) === false){
+ return false;
+ }
+ return true;
}
+ this.fireEvent("activate", this);
+ return true;
},
/**
* Updates this panel's element
adjustForComponents : function(width, height)
{
//Roo.log('adjustForComponents ');
- if(this.title == 'Log Grid'){
- Roo.log('adjustForComponents ');
- Roo.log(this.resizeEl);
- Roo.log(this.el);
- Roo.log(this.adjustments);
- Roo.log([width, height]);
- }
if(this.resizeEl != this.el){
width -= this.el.getFrameWidth('lr');
height -= this.el.getFrameWidth('tb');
}
if(this.toolbar){
var te = this.toolbar.getEl();
- Roo.log(te);
- Roo.log('tool bar height!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1');
- Roo.log(te.getHeight(true));
- height -= te.getHeight();
te.setWidth(width);
+ height -= te.getHeight();
}
if(this.footer){
var te = this.footer.getEl();
- Roo.log("footer:" + te.getHeight());
-
- height -= te.getHeight();
te.setWidth(width);
+ height -= te.getHeight();
}
+
if(this.adjustments){
width += this.adjustments[0];
height += this.adjustments[1];