From 0afae1c65503dddba06a006e893b1ea7513c3ce7 Mon Sep 17 00:00:00 2001 From: Piro / YUKI Hiroshi Date: Sun, 1 Mar 2015 23:35:28 +0900 Subject: [PATCH] Don't try to scroll to the selected tab when it is already in the viewport in its axis. This fixes annoyingly horizontal scroll happend when ColourfulTabs is activated. #842 --- modules/browser.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/modules/browser.js b/modules/browser.js index caa77d39..b0fb7604 100644 --- a/modules/browser.js +++ b/modules/browser.js @@ -483,16 +483,23 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, { { if (!this.windowService.preInitialized || !aTab) return false; + if (aTab.getAttribute('pinned') == 'true') return true; + var tabBox = this.getFutureBoxObject(aTab); var barBox = this.scrollBox.boxObject; - return ( - tabBox.screenX >= barBox.screenX && - tabBox.screenX + tabBox.width <= barBox.screenX + barBox.width && - tabBox.screenY >= barBox.screenY && - tabBox.screenY + tabBox.height <= barBox.screenY + barBox.height - ); + + if (this.isVertical) + return ( + tabBox.screenY >= barBox.screenY && + tabBox.screenY + tabBox.height <= barBox.screenY + barBox.height + ); + else + return ( + tabBox.screenX >= barBox.screenX && + tabBox.screenX + tabBox.width <= barBox.screenX + barBox.width + ); }, isMultiRow : function TSTBrowser_isMultiRow()