+ If you close the selected tab, we now set the selected tab variable to null

This commit is contained in:
Ian Gilman 2010-05-13 11:21:14 -07:00
parent 0f37ecd63a
commit d9f31190e7

View File

@ -355,9 +355,24 @@ window.Page = {
// - Takes a <TabItem>
//
setActiveTab: function(tab){
if( this._activeTab ) this._activeTab.makeDeactive();
if(tab == this._activeTab)
return;
if(this._activeTab) {
this._activeTab.makeDeactive();
this._activeTab.removeOnClose(this);
}
this._activeTab = tab;
tab.makeActive();
if(this._activeTab) {
var self = this;
this._activeTab.addOnClose(this, function() {
self._activeTab = null;
});
this._activeTab.makeActive();
}
},
// ----------