var hp = this.parent ? 1 : 0;
Roo.debug && Roo.log(this);
+ var tree = this._tree ? this._tree() : this.tree();
+
+
if (!el && typeof(this.parent) == 'string' && this.parent.substring(0,1) == '#') {
// if parent is a '#.....' string, then let's use that..
var ename = this.parent.substr(1);
this.parent = false;
Roo.debug && Roo.log(ename);
switch (ename) {
- case 'bootstrap-body' :
+ case 'bootstrap-body':
+ if (typeof(tree.el) != 'undefined' && tree.el == document.body) {
+ // this is the BorderLayout standard?
+ this.parent = { el : true };
+ break;
+ }
+ if (["Nest", "Content"].indexOf(tree.xtype) > -1) {
+ // need to insert stuff...
+ this.parent = {
+ el : new Roo.bootstrap.layout.Border({
+ el : document.body,
+
+ center: {
+ titlebar: false,
+ autoScroll:false,
+ closeOnTab: true,
+ tabPosition: 'top',
+ //resizeTabs: true,
+ alwaysShowTabs: false,
+ hideTabs: true
+ //minTabWidth: 140
+ }
+ })
+
+ };
+ break;
+ }
+
if (typeof(Roo.bootstrap.Body) != 'undefined') {
this.parent = { el : new Roo.bootstrap.Body() };
Roo.debug && Roo.log("setting el to doc body");
Roo.debug && Roo.log("this.parent.el:");
Roo.debug && Roo.log(this.parent.el);
- var tree = this._tree ? this._tree() : this.tree();
// altertive root elements ??? - we need a better way to indicate these.
- var is_alt = (typeof(Roo.bootstrap) != 'undefined' && tree.xns == Roo.bootstrap) ||
- (typeof(Roo.mailer) != 'undefined' && tree.xns == Roo.mailer) ;
+ var is_alt = Roo.XComponent.is_alt ||
+ (typeof(tree.el) != 'undefined' && tree.el == document.body) ||
+ (typeof(Roo.bootstrap) != 'undefined' && tree.xns == Roo.bootstrap) ||
+ (typeof(Roo.mailer) != 'undefined' && tree.xns == Roo.mailer) ;
+
+
if (!this.parent && is_alt) {
//el = Roo.get(document.body);
Roo.debug && Roo.log("no parent - creating one");
el = el ? Roo.get(el) : false;
+ if (typeof(Roo.bootstrap.Body) != 'undefined') {
+
// it's a top level one..
this.parent = {
minTabWidth: 140
}
})
- }
+ };
}
if (!this.parent.el) {
// The 'tree' method is '_tree now'
tree.region = tree.region || this.region;
-
+ var is_body = false;
if (this.parent.el === true) {
// bootstrap... - body..
this.parent.el = Roo.factory(tree);
+ is_body = true;
}
- this.el = this.parent.el.addxtype(tree);
+ this.el = this.parent.el.addxtype(tree, undefined, is_body);
this.fireEvent('built', this);
this.panel = this.el;
elmodules : [],
/**
+ * @property is_alt
+ * Is an alternative Root - normally used by bootstrap or other systems,
+ * where the top element in the tree can wrap 'body'
+ * @type {boolean} (default false)
+ */
+
+ is_alt : false,
+ /**
* @property build_from_html
* Build elements from html - used by bootstrap HTML stuff
* - this is cleared after build is completed
- * @type {boolean} true (default false)
+ * @type {boolean} (default false)
*/
build_from_html : false,
-
/**
* Register components to be built later.
*