mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 14:45:29 +00:00
+ If you close the selected tab, we now set the selected tab variable to null
This commit is contained in:
parent
0f37ecd63a
commit
d9f31190e7
@ -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();
|
||||
}
|
||||
},
|
||||
|
||||
// ----------
|
||||
|
Loading…
Reference in New Issue
Block a user