From 12e8d4635d3e412801d0ddf3e19122de6a041600 Mon Sep 17 00:00:00 2001 From: Piro / SHIMODA Hiroshi Date: Thu, 13 Jan 2011 01:36:14 +0900 Subject: [PATCH] pinned tabs are wrongly positioned if "auto hide" is enabled. --- content/treestyletab/treestyletabbrowser.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 312226c7..02cffd42 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -204,7 +204,11 @@ TreeStyleTabBrowser.prototype = { { var b = this.mTabBrowser; var tabbar = b.tabContainer; - if (!tabbar || !tabbar._positionPinnedTabs) + if ( + !tabbar || + !tabbar._positionPinnedTabs || + !tabbar.boxObject.width + ) return; if (!this.isVertical) { @@ -213,10 +217,13 @@ TreeStyleTabBrowser.prototype = { return; } + var maxWidth = this._tabStripPlaceHolder.boxObject.width || + this.tabStrip.boxObject.width; + var count = this.pinnedTabsCount; var width = aWidth || this.PINNED_TAB_DEFAULT_WIDTH; var height = aHeight || this.PINNED_TAB_DEFAULT_HEIGHT; - var maxCol = Math.floor(this.tabStrip.boxObject.width / width); + var maxCol = Math.floor(maxWidth / width); var maxRow = Math.ceil(count / maxCol); var col = 0; var row = 0;