Add ability to replace closed parent tab with new dummy tab #133
This commit is contained in:
parent
2f12e072e4
commit
b4f153d083
@ -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];
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user