pinTab()した時にツリーから取り除くようにした

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6720 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2010-06-25 16:28:01 +00:00
parent dd260f84f1
commit 9bf5371df6

View File

@ -199,10 +199,24 @@ TreeStyleTabBrowser.prototype = {
}
},
onPinTab : function TSTBrowser_onPinTab(aTab)
{
var parentTab = this.getParentTab(aTab);
this.getChildTabs(aTab).reverse().forEach(
parentTab ?
function(aChildTab) {
this.attachTabTo(aChildTab, parentTab, {
dontExpand : true,
dontMove : true
});
} :
this.partTab,
this);
this.partTab(aTab);
},
onUnpinTab : function TSTBrowser_onUnpinTab(aTab)
{
if (!this.isVertical)
return;
aTab.style.marginLeft = '';
aTab.style.marginTop = '';
},
@ -450,6 +464,17 @@ TreeStyleTabBrowser.prototype = {
);
}
if (b.pinTab) {
eval('b.pinTab = '+
b.pinTab.toSource().replace(
'this.moveTabTo(',
<![CDATA[
this.treeStyleTab.onPinTab(aTab);
$&]]>.toString()
)
);
}
if (b.unpinTab) {
eval('b.unpinTab = '+
b.unpinTab.toSource().replace(
@ -3593,7 +3618,9 @@ TreeStyleTabBrowser.prototype = {
!aChild ||
!aParent ||
aChild == aParent ||
(currentParent = this.getParentTab(aChild)) == aParent
(currentParent = this.getParentTab(aChild)) == aParent ||
aChild.pinned ||
aParent.pinned
) {
this.fireAttachedEvent(aChild, aParent);
return;