Add ability to replace closed parent tab with new dummy tab #133

This commit is contained in:
YUKI Hiroshi 2016-02-12 19:23:56 +09:00
parent 2f12e072e4
commit b4f153d083
2 changed files with 18 additions and 0 deletions

View File

@ -5761,6 +5761,23 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
!utils.getTreePref('closeParentBehavior.moveDetachedTabsToBottom')) {
insertBefore = this.getNextSiblingTab(this.getRootTab(aTab));
}
if (aInfo.behavior == this.kCLOSE_PARENT_BEHAVIOR_REPLACE_WITH_GROUP_TAB) {
let uri = this.getGroupTabURI({
title: aTab.label,
temporary: true
});
let groupTab = b.addTab(uri);
if(parentTab) {
this.attachTabTo(groupTab, parentTab, {
insertBefore : aTab
});
}
this.attachTabTo(aTab, groupTab);
parentTab = groupTab;
aInfo.behavior = this.kCLOSE_PARENT_BEHAVIOR_PROMOTE_ALL_CHILDREN;
}
for (let i = 0, maxi = children.length; i < maxi; i++)
{
let tab = children[i];

View File

@ -198,6 +198,7 @@ var TreeStyleTabConstants = Object.freeze({
kCLOSE_PARENT_BEHAVIOR_DETACH_ALL_CHILDREN : 1,
kCLOSE_PARENT_BEHAVIOR_SIMPLY_DETACH_ALL_CHILDREN : 4,
kCLOSE_PARENT_BEHAVIOR_CLOSE_ALL_CHILDREN : 2, // onTabRemoved only
kCLOSE_PARENT_BEHAVIOR_REPLACE_WITH_GROUP_TAB : 5,
kRESTORE_TREE_LEVEL_NONE : 0,
kRESTORE_TREE_ONLY_VISIBLE : 1,