-<html>\r
-<head>\r
- <title>The source code</title>\r
- <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
- <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
-</head>\r
-<body onload="prettyPrint();">\r
- <pre class="prettyprint lang-js"><div id="cls-Ext.TabPanel"></div>/**
+<html>
+<head>
+ <title>The source code</title>
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
+</head>
+<body onload="prettyPrint();">
+ <pre class="prettyprint lang-js">/*!
+ * Ext JS Library 3.0.3
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+<div id="cls-Ext.TabPanel"></div>/**
* @class Ext.TabPanel
* <p>A basic tab container. TabPanels can be used exactly like a standard {@link Ext.Panel}
* for layout purposes, but also have special support for containing child Components
// private
initEvents : function(){
Ext.TabPanel.superclass.initEvents.call(this);
- this.on('add', this.onAdd, this, {target: this});
- this.on('remove', this.onRemove, this, {target: this});
-
- this.mon(this.strip, 'mousedown', this.onStripMouseDown, this);
- this.mon(this.strip, 'contextmenu', this.onStripContextMenu, this);
+ this.mon(this.strip, {
+ scope: this,
+ mousedown: this.onStripMouseDown,
+ contextmenu: this.onStripContextMenu
+ });
if(this.enableTabScroll){
this.mon(this.strip, 'mousewheel', this.onWheel, this);
}
if(t.close){
if (t.item.fireEvent('beforeclose', t.item) !== false) {
t.item.fireEvent('close', t.item);
+ delete t.item.tabEl;
this.remove(t.item);
}
return;
},
// private
- onAdd : function(tp, item, index){
- this.initTab(item, index);
- if(this.items.getCount() == 1){
- this.syncSize();
+ onAdd : function(c){
+ Ext.TabPanel.superclass.onAdd.call(this, c);
+ if(this.rendered){
+ var items = this.items;
+ this.initTab(c, items.indexOf(c));
+ if(items.getCount() == 1){
+ this.syncSize();
+ }
+ this.delegateUpdates();
}
- this.delegateUpdates();
},
// private
},
// private
- onRemove : function(tp, item){
- Ext.destroy(Ext.get(this.getTabEl(item)));
- this.stack.remove(item);
- item.un('disable', this.onItemDisabled, this);
- item.un('enable', this.onItemEnabled, this);
- item.un('titlechange', this.onItemTitleChanged, this);
- item.un('iconchange', this.onItemIconChanged, this);
- item.un('beforeshow', this.onBeforeShowItem, this);
- if(item == this.activeTab){
+ onRemove : function(c){
+ Ext.TabPanel.superclass.onRemove.call(this, c);
+ Ext.destroy(Ext.get(this.getTabEl(c)));
+ this.stack.remove(c);
+ c.un('disable', this.onItemDisabled, this);
+ c.un('enable', this.onItemEnabled, this);
+ c.un('titlechange', this.onItemTitleChanged, this);
+ c.un('iconchange', this.onItemIconChanged, this);
+ c.un('beforeshow', this.onBeforeShowItem, this);
+ if(c == this.activeTab){
var next = this.stack.next();
if(next){
this.setActiveTab(next);
onItemIconChanged : function(item, iconCls, oldCls){
var el = this.getTabEl(item);
if(el){
- Ext.fly(el).child('span.x-tab-strip-text').replaceClass(oldCls, iconCls);
+ el = Ext.get(el);
+ el.child('span.x-tab-strip-text').replaceClass(oldCls, iconCls);
+ el[Ext.isEmpty(iconCls) ? 'removeClass' : 'addClass']('x-tab-with-icon');
}
},
* @property header
* @hide
*/
- <div id="prop-Ext.TabPanel-title"></div>/**
- * @property title
+ <div id="cfg-Ext.TabPanel-null"></div>/**
+ * @cfg title
* @hide
*/
<div id="cfg-Ext.TabPanel-tools"></div>/**
return items.pop();
}
};
-};</pre> \r
-</body>\r
+};
+</pre>
+</body>
</html>
\ No newline at end of file