diff --git a/content/treestyletab/treestyletab.css b/content/treestyletab/treestyletab.css index 0adf1d4f..7558971b 100644 --- a/content/treestyletab/treestyletab.css +++ b/content/treestyletab/treestyletab.css @@ -87,8 +87,7 @@ tabbrowser[treestyletab-mode="vertical"] .tabs-stack > *:first-child + * > hbox: width: 24px !important; height: 24px !important; } -.tabbrowser-tabs[treestyletab-mode="vertical"] - .tabbrowser-tab[pinned="true"] .tab-text { +.tabbrowser-tab[pinned="true"] .tab-text { visibility: collapse !important; } diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 7f50a5a1..37dd8aa3 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -166,12 +166,14 @@ TreeStyleTabBrowser.prototype = { var maxRow = Math.ceil(count / maxCol); var col = 0; var row = 0; + tabbar.style.MozMarginStart = ''; tabbar.style.marginTop = (height * maxRow)+'px'; - for (var i = 0, count; i < count; i++) + for (var i = 0; i < count; i++) { - let tab = tabbar.childNodes[i]; - tab.style.setProperty('margin-left', (width * col)+'px', 'important'); - tab.style.setProperty('margin-top', (- height * (maxRow - row))+'px', 'important'); + let style = tabbar.childNodes[i].style; + style.MozMarginStart = ''; + style.setProperty('margin-left', (width * col)+'px', 'important'); + style.setProperty('margin-top', (- height * (maxRow - row))+'px', 'important'); col++; if (col >= maxCol) { col = 0; @@ -181,6 +183,29 @@ TreeStyleTabBrowser.prototype = { }, PINNED_TAB_WIDTH : 24, PINNED_TAB_HEIGHT : 24, + + clearPinnedTabsAppearance : function TSTBrowser_clearPinnedTabsAppearance() + { + var b = this.mTabBrowser; + var tabbar = b.tabContainer; + tabbar.style.MozMarginStart = ''; + tabbar.style.marginTop = ''; + for (var i = 0, count = b._numPinnedTabs; i < count; i++) + { + let style = tabbar.childNodes[i].style; + style.MozMarginStart = ''; + style.marginLeft = ''; + style.marginTop = ''; + } + }, + + onUnpinTab : function TSTBrowser_onUnpinTab(aTab) + { + if (!this.isVertical) + return; + aTab.style.marginLeft = ''; + aTab.style.marginTop = ''; + }, /* initialize */ @@ -416,6 +441,7 @@ TreeStyleTabBrowser.prototype = { this.tabbrowser.treeStyleTab.positionVerticalPinnedTabs(); } else { + this.tabbrowser.treeStyleTab.clearPinnedTabsAppearance(); ]]>.toString() ).replace( 'this.mTabstrip.ensureElementIsVisible', @@ -424,6 +450,17 @@ TreeStyleTabBrowser.prototype = { ); } + if (b.unpinTab) { + eval('b.unpinTab = '+ + b.unpinTab.toSource().replace( + 'this.tabContainer._positionPinnedTabs', + .toString() + ) + ); + } + TreeStyleTabService.updateTabDNDObserver(b); if (b.tabContainer && '_getDropIndex' in b.tabContainer) { // Firefox 3.7 or later