いくつかのメソッドをプロパティにした

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@1583 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2007-11-14 19:43:54 +00:00
parent c83457e51c
commit 64ce236858

View File

@ -59,11 +59,13 @@ TreeStyleTabBrowser.prototype = {
/* tree */ /* tree */
getRootTabs : function() get rootTabs()
{ {
return this.evaluateXPath( return this.getArrayFromXPathResult(
this.evaluateXPath(
'child::xul:tab[not(@'+this.kNEST+') or @'+this.kNEST+'="0" or @'+this.kNEST+'=""]', 'child::xul:tab[not(@'+this.kNEST+') or @'+this.kNEST+'="0" or @'+this.kNEST+'=""]',
this.mTabBrowser.mTabContainer this.mTabBrowser.mTabContainer
)
); );
}, },
@ -223,7 +225,7 @@ TreeStyleTabBrowser.prototype = {
value = this.SessionStore.getTabValue(aTab, aKey); value = this.SessionStore.getTabValue(aTab, aKey);
} }
catch(e) { catch(e) {
dump } }
return value; return value;
}, },
@ -266,7 +268,7 @@ dump }
return close; return close;
}, },
isTabVertical : function() get isVertical()
{ {
var b = this.mTabBrowser; var b = this.mTabBrowser;
if (!b) return false; if (!b) return false;
@ -429,12 +431,7 @@ dump }
updateAllTabsIndent : function() updateAllTabsIndent : function()
{ {
this.updateTabsIndent( this.updateTabsIndent(this.rootTabs, 0);
this.getArrayFromXPathResult(
this.getRootTabs()
),
0
);
// this.checkTabsIndentOverflow(); // this.checkTabsIndentOverflow();
}, },
@ -786,8 +783,8 @@ dump }
if (lastPosition - parentPosition + tabSize > containerSize - tabSize) { // out of screen if (lastPosition - parentPosition + tabSize > containerSize - tabSize) { // out of screen
var endPos = parentPosition - b.mTabContainer.firstChild.boxObject[this.positionProp] - tabSize * 0.5; var endPos = parentPosition - b.mTabContainer.firstChild.boxObject[this.positionProp] - tabSize * 0.5;
var endX = this.isTabVertical() ? 0 : endPos ; var endX = this.isVertical ? 0 : endPos ;
var endY = this.isTabVertical() ? endPos : 0 ; var endY = this.isVertical ? endPos : 0 ;
this.scrollTo(endX, endY); this.scrollTo(endX, endY);
} }
else if (!this.isTabInViewport(aTab) && this.isTabInViewport(lastVisible)) { else if (!this.isTabInViewport(aTab) && this.isTabInViewport(lastVisible)) {
@ -1388,7 +1385,7 @@ dump }
var tab = aEvent.target; var tab = aEvent.target;
var b = this.mTabBrowser; var b = this.mTabBrowser;
var tabs = b.mTabContainer.childNodes; var tabs = b.mTabContainer.childNodes;
var isInverted = this.isTabVertical() ? false : window.getComputedStyle(b.parentNode, null).direction == 'rtl'; var isInverted = this.isVertical ? false : window.getComputedStyle(b.parentNode, null).direction == 'rtl';
var info = { var info = {
target : null, target : null,
position : null, position : null,
@ -1887,7 +1884,7 @@ dump }
b._keyEventHandler.handleEvent.toSource().replace( b._keyEventHandler.handleEvent.toSource().replace(
'this.tabbrowser.moveTabOver(aEvent);', 'this.tabbrowser.moveTabOver(aEvent);',
<><![CDATA[ <><![CDATA[
if (!this.tabbrowser.treeStyleTab.isTabVertical() || if (!this.tabbrowser.treeStyleTab.isVertical ||
!this.tabbrowser.treeStyleTab.moveTabLevel(aEvent)) { !this.tabbrowser.treeStyleTab.moveTabLevel(aEvent)) {
this.tabbrowser.moveTabOver(aEvent); this.tabbrowser.moveTabOver(aEvent);
} }
@ -1895,7 +1892,7 @@ dump }
).replace( ).replace(
'this.tabbrowser.moveTabForward();', 'this.tabbrowser.moveTabForward();',
<><![CDATA[ <><![CDATA[
if (this.tabbrowser.treeStyleTab.isTabVertical() || if (this.tabbrowser.treeStyleTab.isVertical ||
!this.tabbrowser.treeStyleTab.moveTabLevel(aEvent)) { !this.tabbrowser.treeStyleTab.moveTabLevel(aEvent)) {
this.tabbrowser.moveTabForward(); this.tabbrowser.moveTabForward();
} }
@ -1903,7 +1900,7 @@ dump }
).replace( ).replace(
'this.tabbrowser.moveTabBackward();', 'this.tabbrowser.moveTabBackward();',
<><![CDATA[ <><![CDATA[
if (this.tabbrowser.treeStyleTab.isTabVertical() || if (this.tabbrowser.treeStyleTab.isVertical ||
!this.tabbrowser.treeStyleTab.moveTabLevel(aEvent)) { !this.tabbrowser.treeStyleTab.moveTabLevel(aEvent)) {
this.tabbrowser.moveTabBackward(); this.tabbrowser.moveTabBackward();
} }