From eb17d17abaf7ecc63e8770d3dae53ba874d6c6ba Mon Sep 17 00:00:00 2001 From: SHIMODA Hiroshi Date: Mon, 17 Jan 2011 10:17:56 +0900 Subject: [PATCH] don't stretch tab contents if the binding is overridden (e.g. by Tab Mix Plus) --- content/treestyletab/treestyletabbrowser.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index e693e0a7..ab987b1d 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -769,13 +769,13 @@ TreeStyleTabBrowser.prototype = { label.parentNode.insertBefore(counter, label.nextSibling); } - // This causes http://piro.sakura.ne.jp/cgi-bin/bbs.cgi?2820 ... - // If TMP is not installed, there is "image-middle" box between tab-icon and tab-content. - // The box has align="center" so the problem doesn't appear if TMP is not installed. - // TMP applies its custom binding and it doesn't have image-middle box... var tabContentBox = document.getAnonymousElementByAttribute(aTab, 'class', 'tab-content'); - if (tabContentBox) + if (tabContentBox && + (tabContentBox.firstChild.className || '').indexOf('tab-image-') > -1) { + // Set stretched only if the tabFx2Compatible.xml is applied. + // Tab Mix Plus overrides the binding so icons are wrongly stretched. tabContentBox.setAttribute('align', this.isVertical ? 'stretch' : 'center' ); + } this.initTabContentsOrder(aTab); }, @@ -2436,6 +2436,7 @@ TreeStyleTabBrowser.prototype = { nextTab = this.getNextTab(tabs[tabs.length-1]); } + var prevParent = this.getParentTab(prevTab); var nextParent = this.getParentTab(nextTab);