タブが消えてしまう問題を修正

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@3758 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-03-04 19:48:22 +00:00
parent 42b8258d85
commit 98a6e194e2
3 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@namespace html url("http://www.w3.org/1999/xhtml");
tabbrowser[treestyletab-mode="vertical"] .tabs-container > .tabbrowser-arrowscrollbox {
tabbrowser .tabs-container > .tabbrowser-arrowscrollbox {
-moz-binding: url("chrome://treestyletab/content/treestyletab.xml#tabbrowser-arrowscrollbox");
}

View File

@ -16,13 +16,15 @@
extends="chrome://browser/content/tabbrowser.xml#tabbrowser-arrowscrollbox">
<handlers>
<handler event="underflow"><![CDATA[
if (event.detail != 0) return; // Ignore horizontal events
var tabs = document.getBindingParent(this);
if ((event.detail == 0) == (tabs.getAttribute('orient') == 'horizontal'))
return;
tabs.removeAttribute("overflow");
]]></handler>
<handler event="overflow"><![CDATA[
if (event.detail != 0) return; // Ignore horizontal events
var tabs = document.getBindingParent(this);
if ((event.detail == 0) == (tabs.getAttribute('orient') == 'horizontal'))
return;
tabs.setAttribute("overflow", "true");
this.scrollBoxObject.ensureElementIsVisible(tabs.selectedItem);
]]></handler>

View File

@ -123,6 +123,8 @@ TreeStyleTabBrowser.prototype = {
b.mTabContainer.addEventListener('select', this, true);
b.mTabContainer.addEventListener('scroll', this, true);
var container = document.getAnonymousElementByAttribute(b.mTabContainer, 'class', 'tabs-container');
if (container) container.removeAttribute('overflow');
/* Closing collapsed last tree breaks selected tab.
To solve this problem, I override the setter to