+ Recommiting changes that got lost.

This commit is contained in:
Aza Raskin 2010-05-08 21:11:57 -07:00
parent 914eeb66de
commit e2342401b3

View File

@ -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: showOnlyTheseTabs
// Hides all of the tabs in the tab bar 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;
});