diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 8d7d19d2..88bccd6a 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -398,61 +398,6 @@ TreeStyleTabBrowser.prototype = { ) ); - eval('b.mTabContainer._handleTabSelect = '+ - b.mTabContainer._handleTabSelect.toSource().replace( - '{', - - ) - ); - -/* - if ('ensureElementIsVisible' in b.mTabContainer.mTabstrip && - '_smoothScrollByPixels' in b.mTabContainer.mTabstrip) { - eval('b.mTabContainer.mTabstrip.ensureElementIsVisible = '+ - b.mTabContainer.mTabstrip.ensureElementIsVisible.toSource().replace( - '{', - - ).replace( - /\.left/g, '[startProp]' - ).replace( - /\.right/g, '[endProp]' - ).replace( - '|| this.getAttribute("orient") == "vertical"', '' - ) - ); - eval('b.mTabContainer.mTabstrip._smoothScrollByPixels = '+ - b.mTabContainer.mTabstrip._smoothScrollByPixels.toSource().replace( - '{', - - ).replace( - 'scrollBy(distance, 0)', - - ) - ); - } -*/ - eval('b.mTabContainer._notifyBackgroundTab = '+ b.mTabContainer._notifyBackgroundTab.toSource().replace( '{', @@ -3014,6 +2959,11 @@ TreeStyleTabBrowser.prototype = { this._focusChangedByShortcut = false; this.updateInvertedTabContentsOrder(); + + if (!this.isTabInViewport(tab)) { + this.scrollToTab(tab); + aEvent.stopPropagation(); + } }, onTabClick : function TSTBrowser_onTabClick(aEvent, aTab)