mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-09 04:25:38 +00:00
+ Fixed a bug where closing the last tab in an un-named group would deposit you on a random tab.
This commit is contained in:
parent
e962f638a4
commit
436d729409
@ -81,6 +81,29 @@ var Tabbar = {
|
||||
$(this.el).animate({"marginTop":0}, speed);
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: getVisibleTabs
|
||||
// Returns an array of the tabs which are currently visibible in the
|
||||
// tab bar.
|
||||
getVisibleTabs: function(){
|
||||
var visibleTabs = [];
|
||||
// UI.tabBar.el.children is not a real array and does contain
|
||||
// useful functions like filter or forEach. Convert it into a real array.
|
||||
for( var i=0; i<UI.tabBar.el.children.length; i++ ){
|
||||
var tab = UI.tabBar.el.children[i];
|
||||
if( tab.collapsed = false )
|
||||
visibleTabs.push();
|
||||
}
|
||||
|
||||
return visibleTabs;
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: getVisibleTabs
|
||||
// Hides all of the tabs which are not passed into this function.
|
||||
//
|
||||
// Paramaters
|
||||
// - An array of <Tab> objects.
|
||||
showOnlyTheseTabs: function(tabs){
|
||||
var visibleTabs = [];
|
||||
// UI.tabBar.el.children is not a real array and does contain
|
||||
@ -144,6 +167,14 @@ window.Page = {
|
||||
var group = Groups.getActiveGroup();
|
||||
if( group && group._children.length == 0 )
|
||||
Page.show();
|
||||
|
||||
// Take care of the case where you've closed the last tab in
|
||||
// an un-named group, which means that the group is gone (null) and
|
||||
// there are no visible tabs.
|
||||
if( group == null && Tabbar.getVisibleTabs().length == 0){
|
||||
Page.show();
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user