From 467b62548452a38f51b10507c8744db6ebb62574 Mon Sep 17 00:00:00 2001 From: Piro / SHIMODA Hiroshi Date: Sun, 5 Jun 2011 03:59:36 +0900 Subject: [PATCH] * With ColorfulTabs, vertical tab bar was wrongly scrolled. (fix for https://github.com/piroor/treestyletab/issues/88 ) * update compatibility hacks for ColorfulTabs --- content/treestyletab/treestyletab.css | 5 +++++ content/treestyletab/windowHelperHacks.js | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/content/treestyletab/treestyletab.css b/content/treestyletab/treestyletab.css index 108bfd04..aed52c47 100644 --- a/content/treestyletab/treestyletab.css +++ b/content/treestyletab/treestyletab.css @@ -502,3 +502,8 @@ image.tab-icon { visibility: collapse; } +/* ColorfulTabs */ +:root:not([treestyletab-tabbar-position="top"]) #ctStack, +:root:not([treestyletab-tabbar-fixed="true"]) #ctStack { + display: none; +} diff --git a/content/treestyletab/windowHelperHacks.js b/content/treestyletab/windowHelperHacks.js index a95edb6b..6ca5adf2 100644 --- a/content/treestyletab/windowHelperHacks.js +++ b/content/treestyletab/windowHelperHacks.js @@ -532,7 +532,7 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove // Colorful Tabs // https://addons.mozilla.org/firefox/addon/1368 - if ('clrtabsInit' in window && + if ('colorfulTabs' in window && sv.getTreePref('compatibility.ColorfulTabs')) { let listener = { handleEvent : function(aEvent) @@ -544,11 +544,11 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove var child = aEvent.originalTarget; var parent = aEvent.parentTab; if (child && parent) { - setColor(child, TreeStyleTabService.SessionStore.getTabValue(parent, 'tabClr')); + colorfulTabs.setColor(child, TreeStyleTabService.SessionStore.getTabValue(parent, 'tabClr')); } else if (child) { - TreeStyleTabService.SessionStore.setTabValue(child, 'tabClr', '') - calcTabClr({ + TreeStyleTabService.SessionStore.setTabValue(child, 'tabClr', ''); + colorfulTabs.calcTabClr({ target : child, originalTarget : child, }); @@ -563,6 +563,12 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove } } }; + eval('colorfulTabs.show_ctStack = '+ + colorfulTabs.show_ctStack.toSource().replace( + '.setProperty("display", "-moz-stack", "important")', + '.display = ""' + ) + ); document.addEventListener('TreeStyleTabAttached', listener, false); document.addEventListener('TreeStyleTabParted', listener, false); document.addEventListener('unload', listener, false);