Ctrl-左右でのタブのツリーの編集機能について、不十分だった箇所を修正

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@1237 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2007-10-19 13:13:44 +00:00
parent 74e8806e17
commit 7f874d60b5

View File

@ -409,20 +409,29 @@ var TreeStyleTabService = {
{
var parentTab = TreeStyleTabService.getParentTabOf(this.mCurrentTab);
if (aEvent.keyCode == KeyEvent.DOM_VK_RIGHT) {
if (parentTab &&
this.mCurrentTab != TreeStyleTabService.getFirstChildTabOf(parentTab)) {
TreeStyleTabService.adoptTabTo(this.mCurrentTab, TreeStyleTabService.getPreviousSiblingTabOf(this.mCurrentTab));
var prevTab = TreeStyleTabService.getPreviousSiblingTabOf(this.mCurrentTab);
if ((!parentTab && prevTab) ||
(parentTab && this.mCurrentTab != TreeStyleTabService.getFirstChildTabOf(parentTab))) {
TreeStyleTabService.adoptTabTo(this.mCurrentTab, prevTab);
this.mCurrentTab.focus();
return;
}
}
else if (aEvent.keyCode == KeyEvent.DOM_VK_LEFT) {
else if (aEvent.keyCode == KeyEvent.DOM_VK_LEFT && parentTab) {
var grandParent = TreeStyleTabService.getParentTabOf(parentTab);
if (grandParent) {
TreeStyleTabService.adoptTabTo(this.mCurrentTab, grandParent, { insertBefore : TreeStyleTabService.getNextSiblingTabOf(parentTab) });
this.mCurrentTab.focus();
return;
}
else {
var nextTab = TreeStyleTabService.getNextSiblingTabOf(parentTab);
TreeStyleTabService.repudiateTab(this.mCurrentTab);
if (nextTab) {
this.moveTabTo(this.mCurrentTab, nextTab._tPos - 1);
}
this.mCurrentTab.focus();
}
return;
}
]]></>
)