From cd6b63974bad9c88e6b9a8e69ddc2a5ce54c48c1 Mon Sep 17 00:00:00 2001 From: piro Date: Tue, 12 May 2009 17:35:06 +0000 Subject: [PATCH] =?UTF-8?q?=E7=A9=BA=E3=81=AE=E3=82=BF=E3=83=96=E3=81=8C1?= =?UTF-8?q?=E3=81=A4=E3=81=A0=E3=81=91=E3=81=82=E3=82=8B=E3=81=A8=E3=81=8D?= =?UTF-8?q?=E3=81=AB=E9=96=89=E3=81=98=E3=81=9F=E3=82=BF=E3=83=96=E3=82=92?= =?UTF-8?q?=E9=96=8B=E3=81=8D=E7=9B=B4=E3=81=99=E3=81=A8=E3=82=BF=E3=83=96?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=81=AE=E4=B8=8A=E7=AB=AF=E3=81=AB=E3=82=B9?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B9=E3=81=8C=E7=A9=BA=E3=81=84=E3=81=A6?= =?UTF-8?q?=E3=81=97=E3=81=BE=E3=81=86=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=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@4415 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 6ae7f51d..87d50445 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -3202,7 +3202,20 @@ TreeStyleTabBrowser.prototype = { var radian = 90 * Math.PI / 180; var self = this; aTab.__treestyletab__updateTabCollapsedTask = function(aTime, aBeginning, aChange, aDuration) { - if (aTime >= aDuration) { + // If this is the last tab, negative scroll happens. + // Then, we shouldn't do animation. + var stopAnimation = false; + var scrollBox = self.scrollBox; + if (scrollBox) { + if (scrollBox._scrollbox) scrollBox = scrollBox._scrollbox; + if ('scrollTop' in scrollBox && + (scrollBox.scrollTop < 0 || scrollBox.scrollLeft < 0)) { + scrollBox.scrollTop = 0; + scrollBox.scrollLeft = 0; + stopAnimation = true; + } + } + if (aTime >= aDuration || stopAnimation) { delete aTab.__treestyletab__updateTabCollapsedTask; aTab.removeAttribute(self.kCOLLAPSING); if (aCollapsed) aTab.setAttribute(self.kCOLLAPSED_DONE, true);