}this.stripWrap=Roo.get(this.createStrip(this.el.dom),true);this.stripEl=Roo.get(this.createStripList(this.stripWrap.dom),true);this.stripBody=Roo.get(this.stripWrap.dom.firstChild.firstChild,true);if(Roo.isIE){Roo.fly(this.stripWrap.dom.firstChild).setStyle("overflow-x","hidden");
}if(this.tabPosition!="bottom"){this.bodyEl=Roo.get(this.createBody(this.el.dom));this.el.addClass("x-tabs-top");}this.items=[];this.bodyEl.setStyle("position","relative");this.active=null;this.activateDelegate=this.activate.createDelegate(this);this.addEvents({"tabchange":true,"beforetabchange":true}
);Roo.EventManager.onWindowResize(this.onResize,this);this.cpad=this.el.getPadding("lr");this.hiddenCount=0;if(this.toolbar){var C=this.toolbar;C.container=this.stripEl.child('td.x-tab-strip-toolbar');this.toolbar=new Roo.Toolbar(C);if(Roo.isSafari){var D=C.container.child('table',true);
-D.setAttribute('width','100%');}}Roo.panel.Tab.superclass.constructor.call(this);};Roo.extend(Roo.panel.Tab,Roo.util.Observable,{tabPosition:"top",currentTabWidth:0,minTabWidth:40,maxTabWidth:250,preferredTabWidth:175,resizeTabs:false,monitorResize:true,toolbar:false,addTab:function(id,A,B,C){var D=new Roo.TabPanelItem(this,id,A,C);
+D.setAttribute('width','100%');}}Roo.panel.Tab.superclass.constructor.call(this);};Roo.extend(Roo.panel.Tab,Roo.util.Observable,{tabPosition:"top",currentTabWidth:0,minTabWidth:40,maxTabWidth:250,preferredTabWidth:175,resizeTabs:false,monitorResize:true,toolbar:false,addTab:function(id,A,B,C){var D=new Roo.panel.TabItem(this,id,A,C);
this.addTabItem(D);if(B){D.setContent(B);}return D;},getTab:function(id){return this.items[id];},hideTab:function(id){var t=this.items[id];if(!t.isHidden()){t.setHidden(true);this.hiddenCount++;this.autoSizeTabs();}},unhideTab:function(id){var t=this.items[id];
if(t.isHidden()){t.setHidden(false);this.hiddenCount--;this.autoSizeTabs();}},addTabItem:function(A){this.items[A.id]=A;this.items.push(A);if(this.resizeTabs){A.setWidth(this.currentTabWidth||this.preferredTabWidth);this.autoSizeTabs();}else{A.autoSize();
}},removeTab:function(id){var A=this.items;var B=A[id];if(!B){return;}var C=A.indexOf(B);if(this.active==B&&A.length>1){var D=this.getNextAvailable(C);if(D){D.activate();}}this.stripEl.dom.removeChild(B.pnode.dom);if(B.bodyEl.dom.parentNode==this.bodyEl.dom){this.bodyEl.dom.removeChild(B.bodyEl.dom);
}},beginUpdate:function(){this.updating=true;},endUpdate:function(){this.updating=false;this.autoSizeTabs();},autoSizeTabs:function(){var A=this.items.length;var B=A-this.hiddenCount;if(!this.resizeTabs||A<1||B<1||this.updating){return;}var w=Math.max(this.el.getWidth()-this.cpad,10);
var C=Math.floor(w/B);var b=this.stripBody;if(b.getWidth()>w){var D=this.items;this.setTabWidth(Math.max(C,this.minTabWidth)-2);if(C<this.minTabWidth){}}else{if(this.currentTabWidth<this.preferredTabWidth){this.setTabWidth(Math.min(C,this.preferredTabWidth)-2);
}}},getCount:function(){return this.items.length;},setTabWidth:function(A){this.currentTabWidth=A;for(var i=0,B=this.items.length;i<B;i++){if(!this.items[i].isHidden()){this.items[i].setWidth(A);}}},destroy:function(A){Roo.EventManager.removeResizeListener(this.onResize,this);
-for(var i=0,B=this.items.length;i<B;i++){this.items[i].purgeListeners();}if(A===true){this.el.update("");this.el.remove();}}});Roo.TabPanelItem=function(A,id,B,C){this.tabPanel=A;this.id=id;this.disabled=false;this.text=B;this.loaded=false;this.closable=C;
-this.bodyEl=Roo.get(A.createItemBody(A.bodyEl.dom,id));this.bodyEl.setVisibilityMode(Roo.Element.VISIBILITY);this.bodyEl.setStyle("display","block");this.bodyEl.setStyle("zoom","1");this.hideAction();var D=A.createStripElements(A.stripEl.dom,B,C);this.el=Roo.get(D.el,true);
-this.inner=Roo.get(D.inner,true);this.textEl=Roo.get(this.el.dom.firstChild.firstChild.firstChild,true);this.pnode=Roo.get(D.el.parentNode,true);this.el.on("mousedown",this.onTabMouseDown,this);this.el.on("click",this.onTabClick,this);if(C){var c=Roo.get(D.close,true);
-c.dom.title=this.closeText;c.addClassOnOver("close-over");c.on("click",this.closeClick,this);}this.addEvents({"activate":true,"beforeclose":true,"close":true,"deactivate":true});this.hidden=false;Roo.TabPanelItem.superclass.constructor.call(this);};Roo.extend(Roo.TabPanelItem,Roo.util.Observable,{purgeListeners:function(){Roo.util.Observable.prototype.purgeListeners.call(this);
-this.el.removeAllListeners();},show:function(){this.pnode.addClass("on");this.showAction();if(Roo.isOpera){this.tabPanel.stripWrap.repaint();}this.fireEvent("activate",this.tabPanel,this);},isActive:function(){return this.tabPanel.getActiveTab()==this;},hide:function(){this.pnode.removeClass("on");
-this.hideAction();this.fireEvent("deactivate",this.tabPanel,this);},hideAction:function(){this.bodyEl.hide();this.bodyEl.setStyle("position","absolute");this.bodyEl.setLeft("-20000px");this.bodyEl.setTop("-20000px");},showAction:function(){this.bodyEl.setStyle("position","relative");
-this.bodyEl.setTop("");this.bodyEl.setLeft("");this.bodyEl.show();},setTooltip:function(A){if(Roo.QuickTips&&Roo.QuickTips.isEnabled()){this.textEl.dom.qtip=A;this.textEl.dom.removeAttribute('title');}else{this.textEl.dom.title=A;}},onTabClick:function(e){e.preventDefault();
-this.tabPanel.activate(this.id);},onTabMouseDown:function(e){e.preventDefault();this.tabPanel.activate(this.id);},getWidth:function(){return this.inner.getWidth();},setWidth:function(A){var B=A-this.pnode.getPadding("lr");this.inner.setWidth(B);this.textEl.setWidth(B-this.inner.getPadding("lr"));
-this.pnode.setWidth(A);},setHidden:function(A){this.hidden=A;this.pnode.setStyle("display",A?"none":"");},isHidden:function(){return this.hidden;},getText:function(){return this.text;},autoSize:function(){this.textEl.setWidth(1);this.setWidth(this.textEl.dom.scrollWidth+this.pnode.getPadding("lr")+this.inner.getPadding("lr")+2);
-},setText:function(A){this.text=A;this.textEl.update(A);this.setTooltip(A);if(!this.tabPanel.resizeTabs){this.autoSize();}},activate:function(){this.tabPanel.activate(this.id);},disable:function(){if(this.tabPanel.active!=this){this.disabled=true;this.pnode.addClass("disabled");
-}},enable:function(){this.disabled=false;this.pnode.removeClass("disabled");},setContent:function(A,B){this.bodyEl.update(A,B);},getUpdateManager:function(){return this.bodyEl.getUpdateManager();},setUrl:function(A,B,C){if(this.refreshDelegate){this.un('activate',this.refreshDelegate);
-}this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]);this.on("activate",this.refreshDelegate);return this.bodyEl.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var D=this.bodyEl.getUpdateManager();D.update(A,B,this._setLoaded.createDelegate(this));
-}},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},_setLoaded:function(){this.loaded=true;},closeClick:function(e){var o={};e.stopEvent();this.fireEvent("beforeclose",this,o);if(o.cancel!==true){this.tabPanel.removeTab(this.id);
-}},closeText:"Close this tab"});Roo.panel.Tab.prototype.createStrip=function(A){var B=document.createElement("div");B.className="x-tabs-wrap";A.appendChild(B);return B;};Roo.panel.Tab.prototype.createStripList=function(A){A.innerHTML='<div class="x-tabs-strip-wrap">'+'<table class="x-tabs-strip" cellspacing="0" cellpadding="0" border="0"><tbody><tr>'+'<td class="x-tab-strip-toolbar"></td></tr></tbody></table></div>';
+for(var i=0,B=this.items.length;i<B;i++){this.items[i].purgeListeners();}if(A===true){this.el.update("");this.el.remove();}}});Roo.panel.Tab.prototype.createStripList=function(A){A.innerHTML='<div class="x-tabs-strip-wrap">'+'<table class="x-tabs-strip" cellspacing="0" cellpadding="0" border="0"><tbody><tr>'+'<td class="x-tab-strip-toolbar"></td></tr></tbody></table></div>';
return A.firstChild.firstChild.firstChild.firstChild;};Roo.panel.Tab.prototype.createBody=function(A){var B=document.createElement("div");Roo.id(B,"tab-body");Roo.fly(B).addClass("x-tabs-body");A.appendChild(B);return B;};Roo.panel.Tab.prototype.createItemBody=function(A,id){var B=Roo.getDom(id);
if(!B){B=document.createElement("div");B.id=id;}Roo.fly(B).addClass("x-tabs-item-body");A.insertBefore(B,A.firstChild);return B;};Roo.panel.Tab.prototype.createStripElements=function(A,B,C){var td=document.createElement("td");A.insertBefore(td,A.childNodes[A.childNodes.length-1]);
if(C){td.className="x-tabs-closable";if(!this.closeTpl){this.closeTpl=new Roo.Template('<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner">'+'<span unselectable="on"'+(this.disableTooltips?'':' title="{text}"')+' class="x-tabs-text">{text}</span>'+'<div unselectable="on" class="close-icon"> </div></em></span></a>');
}var el=this.closeTpl.overwrite(td,{"text":B});var D=el.getElementsByTagName("div")[0];var E=el.getElementsByTagName("em")[0];return {"el":el,"close":D,"inner":E};}else{if(!this.tabTpl){this.tabTpl=new Roo.Template('<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner">'+'<span unselectable="on"'+(this.disableTooltips?'':' title="{text}"')+' class="x-tabs-text">{text}</span></em></span></a>');
}var el=this.tabTpl.overwrite(td,{"text":B});var E=el.getElementsByTagName("em")[0];return {"el":el,"inner":E};}};
+// Roo/panel/TabItem.js
+Roo.panel.TabItem=function(A,id,B,C){this.tabPanel=A;this.id=id;this.disabled=false;this.text=B;this.loaded=false;this.closable=C;this.bodyEl=Roo.get(A.createItemBody(A.bodyEl.dom,id));this.bodyEl.setVisibilityMode(Roo.Element.VISIBILITY);this.bodyEl.setStyle("display","block");
+this.bodyEl.setStyle("zoom","1");this.hideAction();var D=A.createStripElements(A.stripEl.dom,B,C);this.el=Roo.get(D.el,true);this.inner=Roo.get(D.inner,true);this.textEl=Roo.get(this.el.dom.firstChild.firstChild.firstChild,true);this.pnode=Roo.get(D.el.parentNode,true);
+this.el.on("mousedown",this.onTabMouseDown,this);this.el.on("click",this.onTabClick,this);if(C){var c=Roo.get(D.close,true);c.dom.title=this.closeText;c.addClassOnOver("close-over");c.on("click",this.closeClick,this);}this.addEvents({"activate":true,"beforeclose":true,"close":true,"deactivate":true}
+);this.hidden=false;Roo.panel.TabItem.superclass.constructor.call(this);};Roo.extend(Roo.panel.TabItem,Roo.util.Observable,{purgeListeners:function(){Roo.util.Observable.prototype.purgeListeners.call(this);this.el.removeAllListeners();},show:function(){this.pnode.addClass("on");
+this.showAction();if(Roo.isOpera){this.tabPanel.stripWrap.repaint();}this.fireEvent("activate",this.tabPanel,this);},isActive:function(){return this.tabPanel.getActiveTab()==this;},hide:function(){this.pnode.removeClass("on");this.hideAction();this.fireEvent("deactivate",this.tabPanel,this);
+},hideAction:function(){this.bodyEl.hide();this.bodyEl.setStyle("position","absolute");this.bodyEl.setLeft("-20000px");this.bodyEl.setTop("-20000px");},showAction:function(){this.bodyEl.setStyle("position","relative");this.bodyEl.setTop("");this.bodyEl.setLeft("");
+this.bodyEl.show();},setTooltip:function(A){if(Roo.QuickTips&&Roo.QuickTips.isEnabled()){this.textEl.dom.qtip=A;this.textEl.dom.removeAttribute('title');}else{this.textEl.dom.title=A;}},onTabClick:function(e){e.preventDefault();this.tabPanel.activate(this.id);
+},onTabMouseDown:function(e){e.preventDefault();this.tabPanel.activate(this.id);},getWidth:function(){return this.inner.getWidth();},setWidth:function(A){var B=A-this.pnode.getPadding("lr");this.inner.setWidth(B);this.textEl.setWidth(B-this.inner.getPadding("lr"));
+this.pnode.setWidth(A);},setHidden:function(A){this.hidden=A;this.pnode.setStyle("display",A?"none":"");},isHidden:function(){return this.hidden;},getText:function(){return this.text;},autoSize:function(){this.textEl.setWidth(1);this.setWidth(this.textEl.dom.scrollWidth+this.pnode.getPadding("lr")+this.inner.getPadding("lr")+2);
+},setText:function(A){this.text=A;this.textEl.update(A);this.setTooltip(A);if(!this.tabPanel.resizeTabs){this.autoSize();}},activate:function(){this.tabPanel.activate(this.id);},disable:function(){if(this.tabPanel.active!=this){this.disabled=true;this.pnode.addClass("disabled");
+}},enable:function(){this.disabled=false;this.pnode.removeClass("disabled");},setContent:function(A,B){this.bodyEl.update(A,B);},getUpdateManager:function(){return this.bodyEl.getUpdateManager();},setUrl:function(A,B,C){if(this.refreshDelegate){this.un('activate',this.refreshDelegate);
+}this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]);this.on("activate",this.refreshDelegate);return this.bodyEl.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var D=this.bodyEl.getUpdateManager();D.update(A,B,this._setLoaded.createDelegate(this));
+}},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},_setLoaded:function(){this.loaded=true;},closeClick:function(e){var o={};e.stopEvent();this.fireEvent("beforeclose",this,o);if(o.cancel!==true){this.tabPanel.removeTab(this.id);
+}},closeText:"Close this tab"});Roo.panel.Tab.prototype.createStrip=function(A){var B=document.createElement("div");B.className="x-tabs-wrap";A.appendChild(B);return B;};
// Roo/Button.js
Roo.Button=function(A,B){if(!B){B=A;A=B.renderTo||false;}Roo.apply(this,B);this.addEvents({"click":true,"toggle":true,'mouseover':true,'mouseout':true,'render':true});if(this.menu){this.menu=Roo.menu.MenuMgr.get(this.menu);}Roo.util.Observable.call(this);if(A){this.render(A);
}};Roo.extend(Roo.Button,Roo.util.Observable,{hidden:false,disabled:false,pressed:false,tabIndex:undefined,enableToggle:false,menu:undefined,menuAlign:"tl-bl?",iconCls:undefined,type:'button',menuClassTarget:'tr',clickEvent:'click',handleMouseEvents:true,tooltipType:'qtip',render:function(A){var B;
Roo.fly(this.stripWrap.dom.firstChild).setStyle("overflow-x", "hidden");
}
if(this.tabPosition != "bottom"){
- /** The body element that contains {@link Roo.TabPanelItem} bodies. +
+ /** The body element that contains {@link Roo.panel.TabItem} bodies. +
* @type Roo.Element
*/
this.bodyEl = Roo.get(this.createBody(this.el.dom));
* @event tabchange
* Fires when the active tab changes
* @param {Roo.panel.Tab} this
- * @param {Roo.TabPanelItem} activePanel The new active tab
+ * @param {Roo.panel.TabItem} activePanel The new active tab
*/
"tabchange": true,
/**
* Fires before the active tab changes, set cancel to true on the "e" parameter to cancel the change
* @param {Roo.panel.Tab} this
* @param {Object} e Set cancel to true on this object to cancel the tab change
- * @param {Roo.TabPanelItem} tab The tab being changed to
+ * @param {Roo.panel.TabItem} tab The tab being changed to
*/
"beforetabchange" : true
});
toolbar : false,
/**
- * Creates a new {@link Roo.TabPanelItem} by looking for an existing element with the provided id -- if it's not found it creates one.
+ * Creates a new {@link Roo.panel.TabItem} by looking for an existing element with the provided id -- if it's not found it creates one.
* @param {String} id The id of the div to use <b>or create</b>
* @param {String} text The text for the tab
* @param {String} content (optional) Content to put in the TabPanelItem body
* @param {Boolean} closable (optional) True to create a close icon on the tab
- * @return {Roo.TabPanelItem} The created TabPanelItem
+ * @return {Roo.panel.TabItem} The created TabPanelItem
*/
addTab : function(id, text, content, closable){
- var item = new Roo.TabPanelItem(this, id, text, closable);
+ var item = new Roo.panel.TabItem(this, id, text, closable);
this.addTabItem(item);
if(content){
item.setContent(content);
},
/**
- * Returns the {@link Roo.TabPanelItem} with the specified id/index
+ * Returns the {@link Roo.panel.TabItem} with the specified id/index
* @param {String/Number} id The id or index of the TabPanelItem to fetch.
- * @return {Roo.TabPanelItem}
+ * @return {Roo.panel.TabItem}
*/
getTab : function(id){
return this.items[id];
},
/**
- * Hides the {@link Roo.TabPanelItem} with the specified id/index
+ * Hides the {@link Roo.panel.TabItem} with the specified id/index
* @param {String/Number} id The id or index of the TabPanelItem to hide.
*/
hideTab : function(id){
},
/**
- * "Unhides" the {@link Roo.TabPanelItem} with the specified id/index.
+ * "Unhides" the {@link Roo.panel.TabItem} with the specified id/index.
* @param {String/Number} id The id or index of the TabPanelItem to unhide.
*/
unhideTab : function(id){
},
/**
- * Adds an existing {@link Roo.TabPanelItem}.
- * @param {Roo.TabPanelItem} item The TabPanelItem to add
+ * Adds an existing {@link Roo.panel.TabItem}.
+ * @param {Roo.panel.TabItem} item The TabPanelItem to add
*/
addTabItem : function(item){
this.items[item.id] = item;
},
/**
- * Removes a {@link Roo.TabPanelItem}.
+ * Removes a {@link Roo.panel.TabItem}.
* @param {String/Number} id The id or index of the TabPanelItem to remove.
*/
removeTab : function(id){
},
/**
- * Disables a {@link Roo.TabPanelItem}. It cannot be the active tab, if it is this call is ignored.
+ * Disables a {@link Roo.panel.TabItem}. It cannot be the active tab, if it is this call is ignored.
* @param {String/Number} id The id or index of the TabPanelItem to disable.
*/
disableTab : function(id){
},
/**
- * Enables a {@link Roo.TabPanelItem} that is disabled.
+ * Enables a {@link Roo.panel.TabItem} that is disabled.
* @param {String/Number} id The id or index of the TabPanelItem to enable.
*/
enableTab : function(id){
},
/**
- * Activates a {@link Roo.TabPanelItem}. The currently active one will be deactivated.
+ * Activates a {@link Roo.panel.TabItem}. The currently active one will be deactivated.
* @param {String/Number} id The id or index of the TabPanelItem to activate.
- * @return {Roo.TabPanelItem} The TabPanelItem.
+ * @return {Roo.panel.TabItem} The TabPanelItem.
*/
activate : function(id){
var tab = this.items[id];
},
/**
- * Gets the active {@link Roo.TabPanelItem}.
- * @return {Roo.TabPanelItem} The active TabPanelItem or null if none are active.
+ * Gets the active {@link Roo.panel.TabItem}.
+ * @return {Roo.panel.TabItem} The active TabPanelItem or null if none are active.
*/
getActiveTab : function(){
return this.active;
}
});
-/**
- * @class Roo.TabPanelItem
+
+/** @private */
+Roo.panel.Tab.prototype.createStripList = function(strip){
+ // div wrapper for retard IE
+ // returns the "tr" element.
+ strip.innerHTML = '<div class="x-tabs-strip-wrap">'+
+ '<table class="x-tabs-strip" cellspacing="0" cellpadding="0" border="0"><tbody><tr>'+
+ '<td class="x-tab-strip-toolbar"></td></tr></tbody></table></div>';
+ return strip.firstChild.firstChild.firstChild.firstChild;
+};
+/** @private */
+Roo.panel.Tab.prototype.createBody = function(container){
+ var body = document.createElement("div");
+ Roo.id(body, "tab-body");
+ Roo.fly(body).addClass("x-tabs-body");
+ container.appendChild(body);
+ return body;
+};
+/** @private */
+Roo.panel.Tab.prototype.createItemBody = function(bodyEl, id){
+ var body = Roo.getDom(id);
+ if(!body){
+ body = document.createElement("div");
+ body.id = id;
+ }
+ Roo.fly(body).addClass("x-tabs-item-body");
+ bodyEl.insertBefore(body, bodyEl.firstChild);
+ return body;
+};
+/** @private */
+Roo.panel.Tab.prototype.createStripElements = function(stripEl, text, closable){
+ var td = document.createElement("td");
+ stripEl.insertBefore(td, stripEl.childNodes[stripEl.childNodes.length-1]);
+ //stripEl.appendChild(td);
+ if(closable){
+ td.className = "x-tabs-closable";
+ if(!this.closeTpl){
+ this.closeTpl = new Roo.Template(
+ '<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner">' +
+ '<span unselectable="on"' + (this.disableTooltips ? '' : ' title="{text}"') +' class="x-tabs-text">{text}</span>' +
+ '<div unselectable="on" class="close-icon"> </div></em></span></a>'
+ );
+ }
+ var el = this.closeTpl.overwrite(td, {"text": text});
+ var close = el.getElementsByTagName("div")[0];
+ var inner = el.getElementsByTagName("em")[0];
+ return {"el": el, "close": close, "inner": inner};
+ } else {
+ if(!this.tabTpl){
+ this.tabTpl = new Roo.Template(
+ '<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner">' +
+ '<span unselectable="on"' + (this.disableTooltips ? '' : ' title="{text}"') +' class="x-tabs-text">{text}</span></em></span></a>'
+ );
+ }
+ var el = this.tabTpl.overwrite(td, {"text": text});
+ var inner = el.getElementsByTagName("em")[0];
+ return {"el": el, "inner": inner};
+ }
+};/**
+ * @class Roo.panel.TabItem
* @extends Roo.util.Observable
* Represents an individual item (tab plus body) in a TabPanel.
* @param {Roo.panel.Tab} tabPanel The {@link Roo.panel.Tab} this TabPanelItem belongs to
* @param {String} text The text for the tab of this TabPanelItem
* @param {Boolean} closable True to allow this TabPanelItem to be closable (defaults to false)
*/
-Roo.TabPanelItem = function(tabPanel, id, text, closable){
+ Roo.panel.TabItem = function(tabPanel, id, text, closable){
/**
* The {@link Roo.panel.Tab} this TabPanelItem belongs to
* @type Roo.panel.Tab
* @event activate
* Fires when this tab becomes the active tab.
* @param {Roo.panel.Tab} tabPanel The parent TabPanel
- * @param {Roo.TabPanelItem} this
+ * @param {Roo.panel.TabItem} this
*/
"activate": true,
/**
* @event beforeclose
* Fires before this tab is closed. To cancel the close, set cancel to true on e (e.cancel = true).
- * @param {Roo.TabPanelItem} this
+ * @param {Roo.panel.TabItem} this
* @param {Object} e Set cancel to true on this object to cancel the close.
*/
"beforeclose": true,
/**
* @event close
* Fires when this tab is closed.
- * @param {Roo.TabPanelItem} this
+ * @param {Roo.panel.TabItem} this
*/
"close": true,
/**
* @event deactivate
* Fires when this tab is no longer the active tab.
* @param {Roo.panel.Tab} tabPanel The parent TabPanel
- * @param {Roo.TabPanelItem} this
+ * @param {Roo.panel.TabItem} this
*/
"deactivate" : true
});
this.hidden = false;
- Roo.TabPanelItem.superclass.constructor.call(this);
+ Roo.panel.TabItem.superclass.constructor.call(this);
};
-Roo.extend(Roo.TabPanelItem, Roo.util.Observable, {
+Roo.extend(Roo.panel.TabItem, Roo.util.Observable, {
purgeListeners : function(){
Roo.util.Observable.prototype.purgeListeners.call(this);
this.el.removeAllListeners();
strip.className = "x-tabs-wrap";
container.appendChild(strip);
return strip;
-};
-/** @private */
-Roo.panel.Tab.prototype.createStripList = function(strip){
- // div wrapper for retard IE
- // returns the "tr" element.
- strip.innerHTML = '<div class="x-tabs-strip-wrap">'+
- '<table class="x-tabs-strip" cellspacing="0" cellpadding="0" border="0"><tbody><tr>'+
- '<td class="x-tab-strip-toolbar"></td></tr></tbody></table></div>';
- return strip.firstChild.firstChild.firstChild.firstChild;
-};
-/** @private */
-Roo.panel.Tab.prototype.createBody = function(container){
- var body = document.createElement("div");
- Roo.id(body, "tab-body");
- Roo.fly(body).addClass("x-tabs-body");
- container.appendChild(body);
- return body;
-};
-/** @private */
-Roo.panel.Tab.prototype.createItemBody = function(bodyEl, id){
- var body = Roo.getDom(id);
- if(!body){
- body = document.createElement("div");
- body.id = id;
- }
- Roo.fly(body).addClass("x-tabs-item-body");
- bodyEl.insertBefore(body, bodyEl.firstChild);
- return body;
-};
-/** @private */
-Roo.panel.Tab.prototype.createStripElements = function(stripEl, text, closable){
- var td = document.createElement("td");
- stripEl.insertBefore(td, stripEl.childNodes[stripEl.childNodes.length-1]);
- //stripEl.appendChild(td);
- if(closable){
- td.className = "x-tabs-closable";
- if(!this.closeTpl){
- this.closeTpl = new Roo.Template(
- '<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner">' +
- '<span unselectable="on"' + (this.disableTooltips ? '' : ' title="{text}"') +' class="x-tabs-text">{text}</span>' +
- '<div unselectable="on" class="close-icon"> </div></em></span></a>'
- );
- }
- var el = this.closeTpl.overwrite(td, {"text": text});
- var close = el.getElementsByTagName("div")[0];
- var inner = el.getElementsByTagName("em")[0];
- return {"el": el, "close": close, "inner": inner};
- } else {
- if(!this.tabTpl){
- this.tabTpl = new Roo.Template(
- '<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner">' +
- '<span unselectable="on"' + (this.disableTooltips ? '' : ' title="{text}"') +' class="x-tabs-text">{text}</span></em></span></a>'
- );
- }
- var el = this.tabTpl.overwrite(td, {"text": text});
- var inner = el.getElementsByTagName("em")[0];
- return {"el": el, "inner": inner};
- }
};/*
* Based on:
* Ext JS Library 1.1.1
Roo.fly(this.stripWrap.dom.firstChild).setStyle("overflow-x", "hidden");
}
if(this.tabPosition != "bottom"){
- /** The body element that contains {@link Roo.TabPanelItem} bodies. +
+ /** The body element that contains {@link Roo.panel.TabItem} bodies. +
* @type Roo.Element
*/
this.bodyEl = Roo.get(this.createBody(this.el.dom));
* @event tabchange
* Fires when the active tab changes
* @param {Roo.panel.Tab} this
- * @param {Roo.TabPanelItem} activePanel The new active tab
+ * @param {Roo.panel.TabItem} activePanel The new active tab
*/
"tabchange": true,
/**
* Fires before the active tab changes, set cancel to true on the "e" parameter to cancel the change
* @param {Roo.panel.Tab} this
* @param {Object} e Set cancel to true on this object to cancel the tab change
- * @param {Roo.TabPanelItem} tab The tab being changed to
+ * @param {Roo.panel.TabItem} tab The tab being changed to
*/
"beforetabchange" : true
});
toolbar : false,
/**
- * Creates a new {@link Roo.TabPanelItem} by looking for an existing element with the provided id -- if it's not found it creates one.
+ * Creates a new {@link Roo.panel.TabItem} by looking for an existing element with the provided id -- if it's not found it creates one.
* @param {String} id The id of the div to use <b>or create</b>
* @param {String} text The text for the tab
* @param {String} content (optional) Content to put in the TabPanelItem body
* @param {Boolean} closable (optional) True to create a close icon on the tab
- * @return {Roo.TabPanelItem} The created TabPanelItem
+ * @return {Roo.panel.TabItem} The created TabPanelItem
*/
addTab : function(id, text, content, closable){
- var item = new Roo.TabPanelItem(this, id, text, closable);
+ var item = new Roo.panel.TabItem(this, id, text, closable);
this.addTabItem(item);
if(content){
item.setContent(content);
},
/**
- * Returns the {@link Roo.TabPanelItem} with the specified id/index
+ * Returns the {@link Roo.panel.TabItem} with the specified id/index
* @param {String/Number} id The id or index of the TabPanelItem to fetch.
- * @return {Roo.TabPanelItem}
+ * @return {Roo.panel.TabItem}
*/
getTab : function(id){
return this.items[id];
},
/**
- * Hides the {@link Roo.TabPanelItem} with the specified id/index
+ * Hides the {@link Roo.panel.TabItem} with the specified id/index
* @param {String/Number} id The id or index of the TabPanelItem to hide.
*/
hideTab : function(id){
},
/**
- * "Unhides" the {@link Roo.TabPanelItem} with the specified id/index.
+ * "Unhides" the {@link Roo.panel.TabItem} with the specified id/index.
* @param {String/Number} id The id or index of the TabPanelItem to unhide.
*/
unhideTab : function(id){
},
/**
- * Adds an existing {@link Roo.TabPanelItem}.
- * @param {Roo.TabPanelItem} item The TabPanelItem to add
+ * Adds an existing {@link Roo.panel.TabItem}.
+ * @param {Roo.panel.TabItem} item The TabPanelItem to add
*/
addTabItem : function(item){
this.items[item.id] = item;
},
/**
- * Removes a {@link Roo.TabPanelItem}.
+ * Removes a {@link Roo.panel.TabItem}.
* @param {String/Number} id The id or index of the TabPanelItem to remove.
*/
removeTab : function(id){
},
/**
- * Disables a {@link Roo.TabPanelItem}. It cannot be the active tab, if it is this call is ignored.
+ * Disables a {@link Roo.panel.TabItem}. It cannot be the active tab, if it is this call is ignored.
* @param {String/Number} id The id or index of the TabPanelItem to disable.
*/
disableTab : function(id){
},
/**
- * Enables a {@link Roo.TabPanelItem} that is disabled.
+ * Enables a {@link Roo.panel.TabItem} that is disabled.
* @param {String/Number} id The id or index of the TabPanelItem to enable.
*/
enableTab : function(id){
},
/**
- * Activates a {@link Roo.TabPanelItem}. The currently active one will be deactivated.
+ * Activates a {@link Roo.panel.TabItem}. The currently active one will be deactivated.
* @param {String/Number} id The id or index of the TabPanelItem to activate.
- * @return {Roo.TabPanelItem} The TabPanelItem.
+ * @return {Roo.panel.TabItem} The TabPanelItem.
*/
activate : function(id){
var tab = this.items[id];
},
/**
- * Gets the active {@link Roo.TabPanelItem}.
- * @return {Roo.TabPanelItem} The active TabPanelItem or null if none are active.
+ * Gets the active {@link Roo.panel.TabItem}.
+ * @return {Roo.panel.TabItem} The active TabPanelItem or null if none are active.
*/
getActiveTab : function(){
return this.active;
}
});
-/**
- * @class Roo.TabPanelItem
+
+/** @private */
+Roo.panel.Tab.prototype.createStripList = function(strip){
+ // div wrapper for retard IE
+ // returns the "tr" element.
+ strip.innerHTML = '<div class="x-tabs-strip-wrap">'+
+ '<table class="x-tabs-strip" cellspacing="0" cellpadding="0" border="0"><tbody><tr>'+
+ '<td class="x-tab-strip-toolbar"></td></tr></tbody></table></div>';
+ return strip.firstChild.firstChild.firstChild.firstChild;
+};
+/** @private */
+Roo.panel.Tab.prototype.createBody = function(container){
+ var body = document.createElement("div");
+ Roo.id(body, "tab-body");
+ Roo.fly(body).addClass("x-tabs-body");
+ container.appendChild(body);
+ return body;
+};
+/** @private */
+Roo.panel.Tab.prototype.createItemBody = function(bodyEl, id){
+ var body = Roo.getDom(id);
+ if(!body){
+ body = document.createElement("div");
+ body.id = id;
+ }
+ Roo.fly(body).addClass("x-tabs-item-body");
+ bodyEl.insertBefore(body, bodyEl.firstChild);
+ return body;
+};
+/** @private */
+Roo.panel.Tab.prototype.createStripElements = function(stripEl, text, closable){
+ var td = document.createElement("td");
+ stripEl.insertBefore(td, stripEl.childNodes[stripEl.childNodes.length-1]);
+ //stripEl.appendChild(td);
+ if(closable){
+ td.className = "x-tabs-closable";
+ if(!this.closeTpl){
+ this.closeTpl = new Roo.Template(
+ '<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner">' +
+ '<span unselectable="on"' + (this.disableTooltips ? '' : ' title="{text}"') +' class="x-tabs-text">{text}</span>' +
+ '<div unselectable="on" class="close-icon"> </div></em></span></a>'
+ );
+ }
+ var el = this.closeTpl.overwrite(td, {"text": text});
+ var close = el.getElementsByTagName("div")[0];
+ var inner = el.getElementsByTagName("em")[0];
+ return {"el": el, "close": close, "inner": inner};
+ } else {
+ if(!this.tabTpl){
+ this.tabTpl = new Roo.Template(
+ '<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner">' +
+ '<span unselectable="on"' + (this.disableTooltips ? '' : ' title="{text}"') +' class="x-tabs-text">{text}</span></em></span></a>'
+ );
+ }
+ var el = this.tabTpl.overwrite(td, {"text": text});
+ var inner = el.getElementsByTagName("em")[0];
+ return {"el": el, "inner": inner};
+ }
+};/**
+ * @class Roo.panel.TabItem
* @extends Roo.util.Observable
* Represents an individual item (tab plus body) in a TabPanel.
* @param {Roo.panel.Tab} tabPanel The {@link Roo.panel.Tab} this TabPanelItem belongs to
* @param {String} text The text for the tab of this TabPanelItem
* @param {Boolean} closable True to allow this TabPanelItem to be closable (defaults to false)
*/
-Roo.TabPanelItem = function(tabPanel, id, text, closable){
+ Roo.panel.TabItem = function(tabPanel, id, text, closable){
/**
* The {@link Roo.panel.Tab} this TabPanelItem belongs to
* @type Roo.panel.Tab
* @event activate
* Fires when this tab becomes the active tab.
* @param {Roo.panel.Tab} tabPanel The parent TabPanel
- * @param {Roo.TabPanelItem} this
+ * @param {Roo.panel.TabItem} this
*/
"activate": true,
/**
* @event beforeclose
* Fires before this tab is closed. To cancel the close, set cancel to true on e (e.cancel = true).
- * @param {Roo.TabPanelItem} this
+ * @param {Roo.panel.TabItem} this
* @param {Object} e Set cancel to true on this object to cancel the close.
*/
"beforeclose": true,
/**
* @event close
* Fires when this tab is closed.
- * @param {Roo.TabPanelItem} this
+ * @param {Roo.panel.TabItem} this
*/
"close": true,
/**
* @event deactivate
* Fires when this tab is no longer the active tab.
* @param {Roo.panel.Tab} tabPanel The parent TabPanel
- * @param {Roo.TabPanelItem} this
+ * @param {Roo.panel.TabItem} this
*/
"deactivate" : true
});
this.hidden = false;
- Roo.TabPanelItem.superclass.constructor.call(this);
+ Roo.panel.TabItem.superclass.constructor.call(this);
};
-Roo.extend(Roo.TabPanelItem, Roo.util.Observable, {
+Roo.extend(Roo.panel.TabItem, Roo.util.Observable, {
purgeListeners : function(){
Roo.util.Observable.prototype.purgeListeners.call(this);
this.el.removeAllListeners();
strip.className = "x-tabs-wrap";
container.appendChild(strip);
return strip;
-};
-/** @private */
-Roo.panel.Tab.prototype.createStripList = function(strip){
- // div wrapper for retard IE
- // returns the "tr" element.
- strip.innerHTML = '<div class="x-tabs-strip-wrap">'+
- '<table class="x-tabs-strip" cellspacing="0" cellpadding="0" border="0"><tbody><tr>'+
- '<td class="x-tab-strip-toolbar"></td></tr></tbody></table></div>';
- return strip.firstChild.firstChild.firstChild.firstChild;
-};
-/** @private */
-Roo.panel.Tab.prototype.createBody = function(container){
- var body = document.createElement("div");
- Roo.id(body, "tab-body");
- Roo.fly(body).addClass("x-tabs-body");
- container.appendChild(body);
- return body;
-};
-/** @private */
-Roo.panel.Tab.prototype.createItemBody = function(bodyEl, id){
- var body = Roo.getDom(id);
- if(!body){
- body = document.createElement("div");
- body.id = id;
- }
- Roo.fly(body).addClass("x-tabs-item-body");
- bodyEl.insertBefore(body, bodyEl.firstChild);
- return body;
-};
-/** @private */
-Roo.panel.Tab.prototype.createStripElements = function(stripEl, text, closable){
- var td = document.createElement("td");
- stripEl.insertBefore(td, stripEl.childNodes[stripEl.childNodes.length-1]);
- //stripEl.appendChild(td);
- if(closable){
- td.className = "x-tabs-closable";
- if(!this.closeTpl){
- this.closeTpl = new Roo.Template(
- '<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner">' +
- '<span unselectable="on"' + (this.disableTooltips ? '' : ' title="{text}"') +' class="x-tabs-text">{text}</span>' +
- '<div unselectable="on" class="close-icon"> </div></em></span></a>'
- );
- }
- var el = this.closeTpl.overwrite(td, {"text": text});
- var close = el.getElementsByTagName("div")[0];
- var inner = el.getElementsByTagName("em")[0];
- return {"el": el, "close": close, "inner": inner};
- } else {
- if(!this.tabTpl){
- this.tabTpl = new Roo.Template(
- '<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner">' +
- '<span unselectable="on"' + (this.disableTooltips ? '' : ' title="{text}"') +' class="x-tabs-text">{text}</span></em></span></a>'
- );
- }
- var el = this.tabTpl.overwrite(td, {"text": text});
- var inner = el.getElementsByTagName("em")[0];
- return {"el": el, "inner": inner};
- }
};/*
* Based on:
* Ext JS Library 1.1.1
}this.stripWrap=Roo.get(this.createStrip(this.el.dom),true);this.stripEl=Roo.get(this.createStripList(this.stripWrap.dom),true);this.stripBody=Roo.get(this.stripWrap.dom.firstChild.firstChild,true);if(Roo.isIE){Roo.fly(this.stripWrap.dom.firstChild).setStyle("overflow-x","hidden");
}if(this.tabPosition!="bottom"){this.bodyEl=Roo.get(this.createBody(this.el.dom));this.el.addClass("x-tabs-top");}this.items=[];this.bodyEl.setStyle("position","relative");this.active=null;this.activateDelegate=this.activate.createDelegate(this);this.addEvents({"tabchange":true,"beforetabchange":true}
);Roo.EventManager.onWindowResize(this.onResize,this);this.cpad=this.el.getPadding("lr");this.hiddenCount=0;if(this.toolbar){var C=this.toolbar;C.container=this.stripEl.child('td.x-tab-strip-toolbar');this.toolbar=new Roo.Toolbar(C);if(Roo.isSafari){var D=C.container.child('table',true);
-D.setAttribute('width','100%');}}Roo.panel.Tab.superclass.constructor.call(this);};Roo.extend(Roo.panel.Tab,Roo.util.Observable,{tabPosition:"top",currentTabWidth:0,minTabWidth:40,maxTabWidth:250,preferredTabWidth:175,resizeTabs:false,monitorResize:true,toolbar:false,addTab:function(id,A,B,C){var D=new Roo.TabPanelItem(this,id,A,C);
+D.setAttribute('width','100%');}}Roo.panel.Tab.superclass.constructor.call(this);};Roo.extend(Roo.panel.Tab,Roo.util.Observable,{tabPosition:"top",currentTabWidth:0,minTabWidth:40,maxTabWidth:250,preferredTabWidth:175,resizeTabs:false,monitorResize:true,toolbar:false,addTab:function(id,A,B,C){var D=new Roo.panel.TabItem(this,id,A,C);
this.addTabItem(D);if(B){D.setContent(B);}return D;},getTab:function(id){return this.items[id];},hideTab:function(id){var t=this.items[id];if(!t.isHidden()){t.setHidden(true);this.hiddenCount++;this.autoSizeTabs();}},unhideTab:function(id){var t=this.items[id];
if(t.isHidden()){t.setHidden(false);this.hiddenCount--;this.autoSizeTabs();}},addTabItem:function(A){this.items[A.id]=A;this.items.push(A);if(this.resizeTabs){A.setWidth(this.currentTabWidth||this.preferredTabWidth);this.autoSizeTabs();}else{A.autoSize();
}},removeTab:function(id){var A=this.items;var B=A[id];if(!B){return;}var C=A.indexOf(B);if(this.active==B&&A.length>1){var D=this.getNextAvailable(C);if(D){D.activate();}}this.stripEl.dom.removeChild(B.pnode.dom);if(B.bodyEl.dom.parentNode==this.bodyEl.dom){this.bodyEl.dom.removeChild(B.bodyEl.dom);
}},beginUpdate:function(){this.updating=true;},endUpdate:function(){this.updating=false;this.autoSizeTabs();},autoSizeTabs:function(){var A=this.items.length;var B=A-this.hiddenCount;if(!this.resizeTabs||A<1||B<1||this.updating){return;}var w=Math.max(this.el.getWidth()-this.cpad,10);
var C=Math.floor(w/B);var b=this.stripBody;if(b.getWidth()>w){var D=this.items;this.setTabWidth(Math.max(C,this.minTabWidth)-2);if(C<this.minTabWidth){}}else{if(this.currentTabWidth<this.preferredTabWidth){this.setTabWidth(Math.min(C,this.preferredTabWidth)-2);
}}},getCount:function(){return this.items.length;},setTabWidth:function(A){this.currentTabWidth=A;for(var i=0,B=this.items.length;i<B;i++){if(!this.items[i].isHidden()){this.items[i].setWidth(A);}}},destroy:function(A){Roo.EventManager.removeResizeListener(this.onResize,this);
-for(var i=0,B=this.items.length;i<B;i++){this.items[i].purgeListeners();}if(A===true){this.el.update("");this.el.remove();}}});Roo.TabPanelItem=function(A,id,B,C){this.tabPanel=A;this.id=id;this.disabled=false;this.text=B;this.loaded=false;this.closable=C;
-this.bodyEl=Roo.get(A.createItemBody(A.bodyEl.dom,id));this.bodyEl.setVisibilityMode(Roo.Element.VISIBILITY);this.bodyEl.setStyle("display","block");this.bodyEl.setStyle("zoom","1");this.hideAction();var D=A.createStripElements(A.stripEl.dom,B,C);this.el=Roo.get(D.el,true);
-this.inner=Roo.get(D.inner,true);this.textEl=Roo.get(this.el.dom.firstChild.firstChild.firstChild,true);this.pnode=Roo.get(D.el.parentNode,true);this.el.on("mousedown",this.onTabMouseDown,this);this.el.on("click",this.onTabClick,this);if(C){var c=Roo.get(D.close,true);
-c.dom.title=this.closeText;c.addClassOnOver("close-over");c.on("click",this.closeClick,this);}this.addEvents({"activate":true,"beforeclose":true,"close":true,"deactivate":true});this.hidden=false;Roo.TabPanelItem.superclass.constructor.call(this);};Roo.extend(Roo.TabPanelItem,Roo.util.Observable,{purgeListeners:function(){Roo.util.Observable.prototype.purgeListeners.call(this);
-this.el.removeAllListeners();},show:function(){this.pnode.addClass("on");this.showAction();if(Roo.isOpera){this.tabPanel.stripWrap.repaint();}this.fireEvent("activate",this.tabPanel,this);},isActive:function(){return this.tabPanel.getActiveTab()==this;},hide:function(){this.pnode.removeClass("on");
-this.hideAction();this.fireEvent("deactivate",this.tabPanel,this);},hideAction:function(){this.bodyEl.hide();this.bodyEl.setStyle("position","absolute");this.bodyEl.setLeft("-20000px");this.bodyEl.setTop("-20000px");},showAction:function(){this.bodyEl.setStyle("position","relative");
-this.bodyEl.setTop("");this.bodyEl.setLeft("");this.bodyEl.show();},setTooltip:function(A){if(Roo.QuickTips&&Roo.QuickTips.isEnabled()){this.textEl.dom.qtip=A;this.textEl.dom.removeAttribute('title');}else{this.textEl.dom.title=A;}},onTabClick:function(e){e.preventDefault();
-this.tabPanel.activate(this.id);},onTabMouseDown:function(e){e.preventDefault();this.tabPanel.activate(this.id);},getWidth:function(){return this.inner.getWidth();},setWidth:function(A){var B=A-this.pnode.getPadding("lr");this.inner.setWidth(B);this.textEl.setWidth(B-this.inner.getPadding("lr"));
-this.pnode.setWidth(A);},setHidden:function(A){this.hidden=A;this.pnode.setStyle("display",A?"none":"");},isHidden:function(){return this.hidden;},getText:function(){return this.text;},autoSize:function(){this.textEl.setWidth(1);this.setWidth(this.textEl.dom.scrollWidth+this.pnode.getPadding("lr")+this.inner.getPadding("lr")+2);
-},setText:function(A){this.text=A;this.textEl.update(A);this.setTooltip(A);if(!this.tabPanel.resizeTabs){this.autoSize();}},activate:function(){this.tabPanel.activate(this.id);},disable:function(){if(this.tabPanel.active!=this){this.disabled=true;this.pnode.addClass("disabled");
-}},enable:function(){this.disabled=false;this.pnode.removeClass("disabled");},setContent:function(A,B){this.bodyEl.update(A,B);},getUpdateManager:function(){return this.bodyEl.getUpdateManager();},setUrl:function(A,B,C){if(this.refreshDelegate){this.un('activate',this.refreshDelegate);
-}this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]);this.on("activate",this.refreshDelegate);return this.bodyEl.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var D=this.bodyEl.getUpdateManager();D.update(A,B,this._setLoaded.createDelegate(this));
-}},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},_setLoaded:function(){this.loaded=true;},closeClick:function(e){var o={};e.stopEvent();this.fireEvent("beforeclose",this,o);if(o.cancel!==true){this.tabPanel.removeTab(this.id);
-}},closeText:"Close this tab"});Roo.panel.Tab.prototype.createStrip=function(A){var B=document.createElement("div");B.className="x-tabs-wrap";A.appendChild(B);return B;};Roo.panel.Tab.prototype.createStripList=function(A){A.innerHTML='<div class="x-tabs-strip-wrap">'+'<table class="x-tabs-strip" cellspacing="0" cellpadding="0" border="0"><tbody><tr>'+'<td class="x-tab-strip-toolbar"></td></tr></tbody></table></div>';
+for(var i=0,B=this.items.length;i<B;i++){this.items[i].purgeListeners();}if(A===true){this.el.update("");this.el.remove();}}});Roo.panel.Tab.prototype.createStripList=function(A){A.innerHTML='<div class="x-tabs-strip-wrap">'+'<table class="x-tabs-strip" cellspacing="0" cellpadding="0" border="0"><tbody><tr>'+'<td class="x-tab-strip-toolbar"></td></tr></tbody></table></div>';
return A.firstChild.firstChild.firstChild.firstChild;};Roo.panel.Tab.prototype.createBody=function(A){var B=document.createElement("div");Roo.id(B,"tab-body");Roo.fly(B).addClass("x-tabs-body");A.appendChild(B);return B;};Roo.panel.Tab.prototype.createItemBody=function(A,id){var B=Roo.getDom(id);
if(!B){B=document.createElement("div");B.id=id;}Roo.fly(B).addClass("x-tabs-item-body");A.insertBefore(B,A.firstChild);return B;};Roo.panel.Tab.prototype.createStripElements=function(A,B,C){var td=document.createElement("td");A.insertBefore(td,A.childNodes[A.childNodes.length-1]);
if(C){td.className="x-tabs-closable";if(!this.closeTpl){this.closeTpl=new Roo.Template('<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner">'+'<span unselectable="on"'+(this.disableTooltips?'':' title="{text}"')+' class="x-tabs-text">{text}</span>'+'<div unselectable="on" class="close-icon"> </div></em></span></a>');
}var el=this.closeTpl.overwrite(td,{"text":B});var D=el.getElementsByTagName("div")[0];var E=el.getElementsByTagName("em")[0];return {"el":el,"close":D,"inner":E};}else{if(!this.tabTpl){this.tabTpl=new Roo.Template('<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner">'+'<span unselectable="on"'+(this.disableTooltips?'':' title="{text}"')+' class="x-tabs-text">{text}</span></em></span></a>');
}var el=this.tabTpl.overwrite(td,{"text":B});var E=el.getElementsByTagName("em")[0];return {"el":el,"inner":E};}};
+// Roo/panel/TabItem.js
+Roo.panel.TabItem=function(A,id,B,C){this.tabPanel=A;this.id=id;this.disabled=false;this.text=B;this.loaded=false;this.closable=C;this.bodyEl=Roo.get(A.createItemBody(A.bodyEl.dom,id));this.bodyEl.setVisibilityMode(Roo.Element.VISIBILITY);this.bodyEl.setStyle("display","block");
+this.bodyEl.setStyle("zoom","1");this.hideAction();var D=A.createStripElements(A.stripEl.dom,B,C);this.el=Roo.get(D.el,true);this.inner=Roo.get(D.inner,true);this.textEl=Roo.get(this.el.dom.firstChild.firstChild.firstChild,true);this.pnode=Roo.get(D.el.parentNode,true);
+this.el.on("mousedown",this.onTabMouseDown,this);this.el.on("click",this.onTabClick,this);if(C){var c=Roo.get(D.close,true);c.dom.title=this.closeText;c.addClassOnOver("close-over");c.on("click",this.closeClick,this);}this.addEvents({"activate":true,"beforeclose":true,"close":true,"deactivate":true}
+);this.hidden=false;Roo.panel.TabItem.superclass.constructor.call(this);};Roo.extend(Roo.panel.TabItem,Roo.util.Observable,{purgeListeners:function(){Roo.util.Observable.prototype.purgeListeners.call(this);this.el.removeAllListeners();},show:function(){this.pnode.addClass("on");
+this.showAction();if(Roo.isOpera){this.tabPanel.stripWrap.repaint();}this.fireEvent("activate",this.tabPanel,this);},isActive:function(){return this.tabPanel.getActiveTab()==this;},hide:function(){this.pnode.removeClass("on");this.hideAction();this.fireEvent("deactivate",this.tabPanel,this);
+},hideAction:function(){this.bodyEl.hide();this.bodyEl.setStyle("position","absolute");this.bodyEl.setLeft("-20000px");this.bodyEl.setTop("-20000px");},showAction:function(){this.bodyEl.setStyle("position","relative");this.bodyEl.setTop("");this.bodyEl.setLeft("");
+this.bodyEl.show();},setTooltip:function(A){if(Roo.QuickTips&&Roo.QuickTips.isEnabled()){this.textEl.dom.qtip=A;this.textEl.dom.removeAttribute('title');}else{this.textEl.dom.title=A;}},onTabClick:function(e){e.preventDefault();this.tabPanel.activate(this.id);
+},onTabMouseDown:function(e){e.preventDefault();this.tabPanel.activate(this.id);},getWidth:function(){return this.inner.getWidth();},setWidth:function(A){var B=A-this.pnode.getPadding("lr");this.inner.setWidth(B);this.textEl.setWidth(B-this.inner.getPadding("lr"));
+this.pnode.setWidth(A);},setHidden:function(A){this.hidden=A;this.pnode.setStyle("display",A?"none":"");},isHidden:function(){return this.hidden;},getText:function(){return this.text;},autoSize:function(){this.textEl.setWidth(1);this.setWidth(this.textEl.dom.scrollWidth+this.pnode.getPadding("lr")+this.inner.getPadding("lr")+2);
+},setText:function(A){this.text=A;this.textEl.update(A);this.setTooltip(A);if(!this.tabPanel.resizeTabs){this.autoSize();}},activate:function(){this.tabPanel.activate(this.id);},disable:function(){if(this.tabPanel.active!=this){this.disabled=true;this.pnode.addClass("disabled");
+}},enable:function(){this.disabled=false;this.pnode.removeClass("disabled");},setContent:function(A,B){this.bodyEl.update(A,B);},getUpdateManager:function(){return this.bodyEl.getUpdateManager();},setUrl:function(A,B,C){if(this.refreshDelegate){this.un('activate',this.refreshDelegate);
+}this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]);this.on("activate",this.refreshDelegate);return this.bodyEl.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var D=this.bodyEl.getUpdateManager();D.update(A,B,this._setLoaded.createDelegate(this));
+}},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},_setLoaded:function(){this.loaded=true;},closeClick:function(e){var o={};e.stopEvent();this.fireEvent("beforeclose",this,o);if(o.cancel!==true){this.tabPanel.removeTab(this.id);
+}},closeText:"Close this tab"});Roo.panel.Tab.prototype.createStrip=function(A){var B=document.createElement("div");B.className="x-tabs-wrap";A.appendChild(B);return B;};
// Roo/Button.js
Roo.Button=function(A,B){if(!B){B=A;A=B.renderTo||false;}Roo.apply(this,B);this.addEvents({"click":true,"toggle":true,'mouseover':true,'mouseout':true,'render':true});if(this.menu){this.menu=Roo.menu.MenuMgr.get(this.menu);}Roo.util.Observable.call(this);if(A){this.render(A);
}};Roo.extend(Roo.Button,Roo.util.Observable,{hidden:false,disabled:false,pressed:false,tabIndex:undefined,enableToggle:false,menu:undefined,menuAlign:"tl-bl?",iconCls:undefined,type:'button',menuClassTarget:'tr',clickEvent:'click',handleMouseEvents:true,tooltipType:'qtip',render:function(A){var B;