ダミーのタブを除外するように

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4687 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-07-09 01:58:57 +00:00
parent 54f975bc72
commit cccba25eda

View File

@ -1066,10 +1066,10 @@ var TreeStyleTabService = {
).numberValue; ).numberValue;
}, },
isGroupTab : function(aTab) isGroupTab : function(aTab, aLazyCheck)
{ {
return ( return (
aTab.linkedBrowser.sessionHistory.count == 1 && (aLazyCheck || aTab.linkedBrowser.sessionHistory.count == 1) &&
aTab.linkedBrowser.currentURI.spec.indexOf('about:treestyletab-group') > -1 aTab.linkedBrowser.currentURI.spec.indexOf('about:treestyletab-group') > -1
); );
}, },
@ -2170,27 +2170,29 @@ catch(e) {
tabs = [aTabOrTabs]; tabs = [aTabOrTabs];
} }
var b = this.getTabBrowserFromChild(tabs[0]); var folderName = null;
var bookmarkedTabs = []; if (this.isGroupTab(tabs[0], true)) {
for (var i = 0, maxi = tabs.length; i < maxi; i++) folderName = tabs[0].label;
{ tabs.splice(0, 1);
bookmarkedTabs.push(tabs[i]);
bookmarkedTabs = bookmarkedTabs.concat(b.treeStyleTab.getDescendantTabs(tabs[i]));
} }
if (this.isGroupTab(bookmarkedTabs[0])) var b = this.getTabBrowserFromChild(tabs[0]);
bookmarkedTabs[0].splice(0, 1); var bookmarkedTabs = [];
tabs.forEach(function(aTab) {
if (!this.isGroupTab(aTab)) bookmarkedTabs.push(aTab);
bookmarkedTabs = bookmarkedTabs.concat(b.treeStyleTab.getDescendantTabs(aTab));
}, this);
if ('MultipleTabService' in window && if ('MultipleTabService' in window &&
'addBookmarkFor' in MultipleTabService) { 'addBookmarkFor' in MultipleTabService) {
MultipleTabService.addBookmarkFor(bookmarkedTabs); MultipleTabService.addBookmarkFor(bookmarkedTabs, folderName);
} }
else { else {
this._addBookmarkFor(bookmarkedTabs); this._addBookmarkFor(bookmarkedTabs, folderName);
} }
}, },
_addBookmarkFor : function(aTabs) // from Multiple Tab Handler _addBookmarkFor : function(aTabs, aFolder) // from Multiple Tab Handler
{ {
if (!aTabs) return; if (!aTabs) return;
@ -2236,7 +2238,7 @@ catch(e) {
(aTabs.length == 1 ? (aTabs.length == 1 ?
tabsInfo[0] : tabsInfo[0] :
{ {
name : gNavigatorBundle.getString('bookmarkAllTabsDefault'), name : (aFolderName || gNavigatorBundle.getString('bookmarkAllTabsDefault')),
bBookmarkAllTabs : true, bBookmarkAllTabs : true,
objGroup : tabsInfo objGroup : tabsInfo
} }