From 32cb03d981576e7e3fcfedef52bef944b0f13000 Mon Sep 17 00:00:00 2001 From: piro Date: Sun, 25 Jul 2010 16:06:03 +0000 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E3=81=97=E3=81=8F=E9=96=8B=E3=81=8B?= =?UTF-8?q?=E3=82=8C=E3=81=9F=E3=82=BF=E3=83=96=E3=81=AB=E3=81=A4=E3=81=84?= =?UTF-8?q?=E3=81=A6=E3=80=81=E3=81=9D=E3=81=AE=E3=82=BF=E3=83=96=E3=81=8C?= =?UTF-8?q?=E8=A6=8B=E3=81=88=E3=82=8B=E4=BD=8D=E7=BD=AE=E3=81=BE=E3=81=A7?= =?UTF-8?q?=E3=82=B9=E3=82=AF=E3=83=AD=E3=83=BC=E3=83=AB=E3=81=97=E3=81=9F?= =?UTF-8?q?=E6=99=82=E3=81=AB=E7=8F=BE=E5=9C=A8=E3=81=AE=E3=82=BF=E3=83=96?= =?UTF-8?q?=E3=81=8C=E3=82=B9=E3=82=AF=E3=83=AD=E3=83=BC=E3=83=AB=E3=82=A2?= =?UTF-8?q?=E3=82=A6=E3=83=88=E3=81=97=E3=81=A6=E3=81=97=E3=81=BE=E3=82=8F?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=81=AE=E3=81=A7=E3=81=82=E3=82=8C=E3=81=B0?= =?UTF-8?q?=E3=80=81=E3=81=9D=E3=81=AE=E3=82=BF=E3=83=96=E3=81=AE=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E3=81=BE=E3=81=A7=E3=82=B9=E3=82=AF=E3=83=AD=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97?= =?UTF-8?q?=E3=81=9F?= 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@7032 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 4a823fff..81169dbf 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -2046,6 +2046,8 @@ TreeStyleTabBrowser.prototype = { }, 0, this); } + this.scrollToTab(tab, true); + return true; }, _checkRestoringWindowTimerOnTabAdded : null, @@ -4553,7 +4555,7 @@ TreeStyleTabBrowser.prototype = { }, smoothScrollTask : null, - scrollToTab : function TSTBrowser_scrollToTab(aTab) + scrollToTab : function TSTBrowser_scrollToTab(aTab, aOnlyWhenCurrentTabIsInViewport) { if (!aTab || !aTab.parentNode || this.isTabInViewport(aTab)) return; @@ -4583,6 +4585,13 @@ TreeStyleTabBrowser.prototype = { (targetTabBox.screenY + yOffset - baseTabBox.screenY) - (targetTabBox.height * 0.5) : (targetTabBox.screenY + yOffset - baseTabBox.screenY) - scrollBoxObject.height + (targetTabBox.height * 1.5) ; + if (aOnlyWhenCurrentTabIsInViewport && b.selectedTab != aTab) { + let box = b.selectedTab.boxObject; + if (targetTabBox.screenX - box.screenX + baseTabBox.width + xOffset > scrollBoxObject.width || + targetTabBox.screenY - box.screenY + baseTabBox.height + yOffset > scrollBoxObject.height) + return; + } + this.scrollTo(targetX, targetY); },