From 7f874d60b599a08320973afdef750feeb75f2b2e Mon Sep 17 00:00:00 2001 From: piro Date: Fri, 19 Oct 2007 13:13:44 +0000 Subject: [PATCH] =?UTF-8?q?Ctrl-=E5=B7=A6=E5=8F=B3=E3=81=A7=E3=81=AE?= =?UTF-8?q?=E3=82=BF=E3=83=96=E3=81=AE=E3=83=84=E3=83=AA=E3=83=BC=E3=81=AE?= =?UTF-8?q?=E7=B7=A8=E9=9B=86=E6=A9=9F=E8=83=BD=E3=81=AB=E3=81=A4=E3=81=84?= =?UTF-8?q?=E3=81=A6=E3=80=81=E4=B8=8D=E5=8D=81=E5=88=86=E3=81=A0=E3=81=A3?= =?UTF-8?q?=E3=81=9F=E7=AE=87=E6=89=80=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@1237 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 4a92d547..9484d07d 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -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; } ]]> )