Add a secret preference to disable the safeguard for infinity promoting of all children #988

This commit is contained in:
Piro / YUKI Hiroshi 2015-11-30 01:04:54 +09:00
parent 184555c3fa
commit 34278450e1
2 changed files with 21 additions and 1 deletions

View File

@ -565,6 +565,25 @@ pref("extensions.treestyletab.closeParentBehavior", 3);
* if this is "true". Otherwise the new position is between [A-2-2] and [B].
*/
pref("extensions.treestyletab.closeParentBehavior.moveDetachedTabsToBottom", false);
/**
* When closeParentBehavior = 3, you'll see infinity promoting for all children like:
* +[A]
* +[A-1]
* +[A-1-1]
* +[A-1-2]
* +[A-1-3]
* (close A-1)=>
* +[A]
* +[A-1-1]
* +[A-1-2]
* +[A-1-3]
* (close A-1-1)=>
* +[A]
* +[A-1-2]
* +[A-1-3]
* This preference prevents such an annoying behavior. However, you can disable this safeguard if you don't want.
*/
pref("extensions.treestyletab.closeParentBehavior.promoteAllChildrenWhenParentIsLastChild", true);
/**
* How to treat children of a closed root tab (which has no parent).
* 3 = Promote the first child tab to the new root.

View File

@ -5737,7 +5737,8 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
// This is similar to "taking by representation".
if (behavior == this.kCLOSE_PARENT_BEHAVIOR_PROMOTE_FIRST_CHILD &&
parentTab &&
this.getChildTabs(parentTab).length == 1)
this.getChildTabs(parentTab).length == 1 &&
utils.getTreePref('closeParentBehavior.promoteAllChildrenWhenParentIsLastChild'))
behavior = this.kCLOSE_PARENT_BEHAVIOR_PROMOTE_ALL_CHILDREN;
return behavior;