children of a newly pinned tab should be treated same to children of a closed tab (partial fix for https://github.com/piroor/treestyletab/issues/155 )

This commit is contained in:
SHIMODA Hiroshi 2011-09-06 11:33:38 +09:00
parent edea442249
commit 6201e7a523

View File

@ -3520,25 +3520,31 @@ TreeStyleTabBrowser.prototype = {
{
var parentTab = this.getParentTab(aTab);
if (!parentTab)
if (!parentTab) {
this.collapseExpandSubtree(aTab, false);
this.getChildTabs(aTab).reverse().forEach(
parentTab ?
function(aChildTab) {
this.attachTabTo(aChildTab, parentTab, {
dontExpand : true,
}
else {
let b = this.browser;
this.internallyTabMovingCount++;
this.getChildTabs(aTab).reverse().forEach(function(aChildTab) {
/**
* Children of the newly pinned tab are possibly
* moved to the top of the tab bar, by TabMove event
* from the newly pinned tab. So, we have to
* reposition unexpectedly moved children.
*/
dontMove : aChildTab._tPos > parentTab._tPos
if (aChildTab._tPos < parentTab._tPos)
b.moveTabTo(aChildTab, parentTab._tPos);
}, this);
this.internallyTabMovingCount--;
}
this.partAllChildren(aTab, {
behavior : this.getCloseParentBehaviorForTab(
aTab,
this.kCLOSE_PARENT_BEHAVIOR_PROMOTE_FIRST_CHILD
)
});
} :
this.partTab,
this);
this.partTab(aTab);
this.collapseExpandTab(aTab, false);