ドロップ位置がおかしくなることがあったのを修正
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@1249 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
01c5e4ee39
commit
5af75957f9
@ -451,15 +451,31 @@ catch(e) {
|
|||||||
var tabs = aSelf.mTabContainer.childNodes;
|
var tabs = aSelf.mTabContainer.childNodes;
|
||||||
if (info.action & TreeStyleTabService.kACTION_PART) {
|
if (info.action & TreeStyleTabService.kACTION_PART) {
|
||||||
TreeStyleTabService.partTab(tab);
|
TreeStyleTabService.partTab(tab);
|
||||||
if (info.action & TreeStyleTabService.kACTION_MOVE) {
|
if (
|
||||||
aSelf.moveTabTo(tab, (info.insertBefore ? info.insertBefore._tPos : tabs.length - 1 ));
|
info.action & TreeStyleTabService.kACTION_MOVE &&
|
||||||
|
(
|
||||||
|
!info.insertBefore ||
|
||||||
|
TreeStyleTabService.getNextVisibleTab(tab) != info.insertBefore
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
var newIndex = info.insertBefore ? info.insertBefore._tPos : tabs.length - 1 ;
|
||||||
|
if (info.insertBefore && newIndex > tab._tPos) newIndex--;
|
||||||
|
aSelf.moveTabTo(tab, newIndex);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (info.action & TreeStyleTabService.kACTION_ATTACH) {
|
else if (info.action & TreeStyleTabService.kACTION_ATTACH) {
|
||||||
TreeStyleTabService.attachTabTo(tab, info.parent);
|
TreeStyleTabService.attachTabTo(tab, info.parent);
|
||||||
if (info.action & TreeStyleTabService.kACTION_MOVE) {
|
if (
|
||||||
aSelf.moveTabTo(tab, info.insertBefore ? info.insertBefore._tPos : tabs.length - 1 );
|
info.action & TreeStyleTabService.kACTION_MOVE &&
|
||||||
|
(
|
||||||
|
!info.insertBefore ||
|
||||||
|
TreeStyleTabService.getNextVisibleTab(tab) != info.insertBefore
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
var newIndex = info.insertBefore ? info.insertBefore._tPos : tabs.length - 1 ;
|
||||||
|
if (info.insertBefore && newIndex > tab._tPos) newIndex--;
|
||||||
|
aSelf.moveTabTo(tab, newIndex);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1286,13 +1302,13 @@ catch(e) {
|
|||||||
[TARGET ] <EFBFBD>ªpart from parent, and move
|
[TARGET ] <EFBFBD>ªpart from parent, and move
|
||||||
|
|
||||||
[ ]
|
[ ]
|
||||||
[TARGET ] <EFBFBD>ªattach to the parent of the previous visible, and move
|
[TARGET ] <EFBFBD>ªattach to the parent of the target, and move
|
||||||
|
|
||||||
[ ]
|
[ ]
|
||||||
[TARGET ] <EFBFBD>ªattach to the parent of the target, and move
|
[TARGET ] <EFBFBD>ªattach to the parent of the target, and move
|
||||||
|
|
||||||
[ ]
|
[ ]
|
||||||
[TARGET] <EFBFBD>ªattach to the parent of the targetm and move
|
[TARGET] <EFBFBD>ªattach to the parent of the target (previous tab), and move
|
||||||
*/
|
*/
|
||||||
var prevTab = this.getPreviousVisibleTab(tab);
|
var prevTab = this.getPreviousVisibleTab(tab);
|
||||||
if (!prevTab) {
|
if (!prevTab) {
|
||||||
@ -1304,7 +1320,6 @@ catch(e) {
|
|||||||
var targetNest = Number(tab.getAttribute(this.kNEST));
|
var targetNest = Number(tab.getAttribute(this.kNEST));
|
||||||
info.action = this.kACTION_MOVE | this.kACTION_ATTACH;
|
info.action = this.kACTION_MOVE | this.kACTION_ATTACH;
|
||||||
info.parent = (
|
info.parent = (
|
||||||
(prevNest > targetNest) ? this.getParentTab(prevTab) :
|
|
||||||
(prevNest < targetNest) ? prevTab :
|
(prevNest < targetNest) ? prevTab :
|
||||||
this.getParentTab(tab)
|
this.getParentTab(tab)
|
||||||
) || tab ;
|
) || tab ;
|
||||||
@ -1314,7 +1329,7 @@ catch(e) {
|
|||||||
|
|
||||||
case this.kDROP_AFTER:
|
case this.kDROP_AFTER:
|
||||||
/*
|
/*
|
||||||
[TARGET ] <EFBFBD>«part from parent, and move
|
[TARGET ] <EFBFBD>«if the target has a parent, attach to it and and move
|
||||||
|
|
||||||
[TARGET] <EFBFBD>«attach to the parent of the target, and move
|
[TARGET] <EFBFBD>«attach to the parent of the target, and move
|
||||||
[ ]
|
[ ]
|
||||||
@ -1327,14 +1342,14 @@ catch(e) {
|
|||||||
*/
|
*/
|
||||||
var nextTab = this.getNextVisibleTab(tab);
|
var nextTab = this.getNextVisibleTab(tab);
|
||||||
if (!nextTab) {
|
if (!nextTab) {
|
||||||
info.action = this.kACTION_MOVE | this.kACTION_PART;
|
info.action = this.kACTION_MOVE | this.kACTION_ATTACH;
|
||||||
|
info.parent = this.getParentTab(tab);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var targetNest = Number(tab.getAttribute(this.kNEST));
|
var targetNest = Number(tab.getAttribute(this.kNEST));
|
||||||
var nextNest = Number(nextTab.getAttribute(this.kNEST));
|
var nextNest = Number(nextTab.getAttribute(this.kNEST));
|
||||||
info.action = this.kACTION_MOVE | this.kACTION_ATTACH;
|
info.action = this.kACTION_MOVE | this.kACTION_ATTACH;
|
||||||
info.parent = (
|
info.parent = (
|
||||||
(targetNest > nextNest) ? this.getParentTab(nextTab) :
|
|
||||||
(targetNest < nextNest) ? tab :
|
(targetNest < nextNest) ? tab :
|
||||||
this.getParentTab(tab)
|
this.getParentTab(tab)
|
||||||
) || tab ;
|
) || tab ;
|
||||||
@ -1547,6 +1562,7 @@ catch(e) {
|
|||||||
|
|
||||||
if (!aDontUpdateIndent) {
|
if (!aDontUpdateIndent) {
|
||||||
this.updateTabsIndent([aChild]);
|
this.updateTabsIndent([aChild]);
|
||||||
|
var b = this.getTabBrowserFromChildren(aChild);
|
||||||
this.checkTabsIndentOverflow(b);
|
this.checkTabsIndentOverflow(b);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user