From f29a0ee7791e6683437c279592675c70625b4f1d Mon Sep 17 00:00:00 2001 From: Piro / SHIMODA Hiroshi Date: Sat, 19 Mar 2011 06:06:04 +0900 Subject: [PATCH] pinned tabs were sometimes misrepositioned. --- content/treestyletab/treestyletabbrowser.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 8bdd0998..4f06c7c4 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -62,8 +62,10 @@ TreeStyleTabBrowser.prototype = { }, get scrollBoxObject() { - return (this.scrollBox.scrollBoxObject || this.scrollBox.boxObject) - .QueryInterface(Components.interfaces.nsIScrollBoxObject); // Tab Mix Plus (ensure scrollbox-ed) + var node = this.scrollBox; + if (node._scrollbox) node = node._scrollbox; + return (node.scrollBoxObject || node.boxObject) + .QueryInterface(Components.interfaces.nsIScrollBoxObject); // for Tab Mix Plus (ensure scrollbox-ed) }, get splitter() @@ -329,7 +331,7 @@ TreeStyleTabBrowser.prototype = { var row = 0; tabbar.style.MozMarginStart = ''; tabbar.style.setProperty('margin-top', (height * maxRow)+'px', 'important'); - for (var i = 0; i < count; i++) + for (let i = 0; i < count; i++) { let style = tabbar.childNodes[i].style; style.MozMarginStart = ''; @@ -349,7 +351,10 @@ TreeStyleTabBrowser.prototype = { return; this.positionPinnedTabsWithDelayTimer = window.setTimeout(function(aSelf) { - aSelf.positionPinnedTabs(); + aSelf.Deferred.next(function() { + // do with delay again, after Firefox's reposition was completely finished. + aSelf.positionPinnedTabs(); + }); aSelf.positionPinnedTabsWithDelayTimer = null; }, 0, this); }, @@ -3304,7 +3309,7 @@ TreeStyleTabBrowser.prototype = { this.partTab(aTab); this.collapseExpandTab(aTab, false); - if (this.isVertical) this.positionPinnedTabs(); + if (this.isVertical) this.positionPinnedTabsWithDelay(); }, onUnpinTab : function TSTBrowser_onUnpinTab(aTab) @@ -3313,7 +3318,7 @@ TreeStyleTabBrowser.prototype = { aTab.style.marginTop = ''; this.updateInvertedTabContentsOrder(aTab); - if (this.isVertical) this.positionPinnedTabs(); + if (this.isVertical) this.positionPinnedTabsWithDelay(); }, onDOMAttrModified : function TSTBrowser_onDOMAttrModified(aEvent)