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); var parentTab = this.getParentTab(aTab);
if (!parentTab) if (!parentTab) {
this.collapseExpandSubtree(aTab, false); this.collapseExpandSubtree(aTab, false);
}
this.getChildTabs(aTab).reverse().forEach( else {
parentTab ? let b = this.browser;
function(aChildTab) { this.internallyTabMovingCount++;
this.attachTabTo(aChildTab, parentTab, { this.getChildTabs(aTab).reverse().forEach(function(aChildTab) {
dontExpand : true,
/** /**
* Children of the newly pinned tab are possibly * Children of the newly pinned tab are possibly
* moved to the top of the tab bar, by TabMove event * moved to the top of the tab bar, by TabMove event
* from the newly pinned tab. So, we have to * from the newly pinned tab. So, we have to
* reposition unexpectedly moved children. * 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.partTab(aTab);
this.collapseExpandTab(aTab, false); this.collapseExpandTab(aTab, false);