ドラッグ元のタブをドラッグ元のタブ自身に子として登録しようとして固まることがあったのを修正

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@1248 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2007-10-20 12:45:03 +00:00
parent 5a64163bec
commit 01c5e4ee39

View File

@ -1211,12 +1211,17 @@ catch(e) {
info.canDrop = true;
if (info.action & this.kACTION_ATTACH) {
var orig = aDragSession.sourceNode;
var tab = info.target;
while (tab = this.getParentTab(tab))
{
if (tab != orig) continue;
if (orig == info.parent) {
info.canDrop = false;
break;
}
else {
var tab = info.target;
while (tab = this.getParentTab(tab))
{
if (tab != orig) continue;
info.canDrop = false;
break;
}
}
}
return info;
@ -1443,7 +1448,14 @@ catch(e) {
attachTabTo : function(aChild, aParent, aInfo)
{
if (!aChild || !aParent || this.getParentTab(aChild) == aParent) return;
if (
!aChild ||
!aParent ||
aChild == aParent ||
this.getParentTab(aChild) == aParent
)
return;
if (!aInfo) aInfo = {};
var id = aChild.getAttribute(this.kID);