From 283a79e56c193b096f138a7c84349840c068e6fc Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Tue, 17 Mar 2015 17:59:20 +0900 Subject: [PATCH] Always override ensureElementIsVisible() if animation effect is active --- content/treestyletab/windowHelper.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/content/treestyletab/windowHelper.js b/content/treestyletab/windowHelper.js index da0a6071..95eea34d 100644 --- a/content/treestyletab/windowHelper.js +++ b/content/treestyletab/windowHelper.js @@ -558,15 +558,12 @@ var TreeStyleTabWindowHelper = { scrollbox.__treestyletab__ensureElementIsVisible = scrollbox.ensureElementIsVisible; scrollbox.ensureElementIsVisible = function(...aArgs) { var treeStyleTab = TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab; - if (treeStyleTab && treeStyleTab.shouldCancelEnsureElementIsVisible()) - return; - - if ( - treeStyleTab && - (aArgs.length == 1 || aArgs[1]) - ) - return treeStyleTab.scrollToTab(aArgs[0]); - + if (treeStyleTab) { + if (treeStyleTab.shouldCancelEnsureElementIsVisible()) + return; + else if (treeStyleTab.animationEnabled) + return treeStyleTab.scrollToTab(aArgs[0]); + } this.__treestyletab__ensureElementIsVisible.apply(this, aArgs); }; }