折りたたみ可能かどうかの判定がおかしくなっていた
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5266 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
ec8cf69153
commit
2a65b99cab
@ -821,8 +821,7 @@ var TreeStyleTabService = {
|
||||
{
|
||||
if (!aTab) return null;
|
||||
|
||||
var b = this.getTabBrowserFromChild(aTab) || this.browser;
|
||||
if (b.getAttribute(this.kALLOW_COLLAPSE) != 'true')
|
||||
if (!this.canCollapseSubtree(aTab))
|
||||
return this.getNextTab(aTab);
|
||||
|
||||
return this.evaluateXPath(
|
||||
@ -836,8 +835,7 @@ var TreeStyleTabService = {
|
||||
{
|
||||
if (!aTab) return null;
|
||||
|
||||
var b = this.getTabBrowserFromChild(aTab) || this.browser;
|
||||
if (b.getAttribute(this.kALLOW_COLLAPSE) != 'true')
|
||||
if (!this.canCollapseSubtree(aTab))
|
||||
return this.getPreviousTab(aTab);
|
||||
|
||||
return this.evaluateXPath(
|
||||
@ -851,8 +849,7 @@ var TreeStyleTabService = {
|
||||
{
|
||||
if (!aTab) return null;
|
||||
|
||||
var b = this.getTabBrowserFromChild(aTab) || this.browser;
|
||||
if (b.getAttribute(this.kALLOW_COLLAPSE) != 'true')
|
||||
if (!this.canCollapseSubtree(aTab))
|
||||
return this.getLastTab(aTab);
|
||||
|
||||
return this.evaluateXPath(
|
||||
@ -864,8 +861,7 @@ var TreeStyleTabService = {
|
||||
|
||||
getVisibleTabs : function(aTab)
|
||||
{
|
||||
var b = this.getTabBrowserFromChild(aTab) || this.browser;
|
||||
if (b.getAttribute(this.kALLOW_COLLAPSE) != 'true')
|
||||
if (!this.canCollapseSubtree(aTab))
|
||||
return this.getTabs(b);
|
||||
|
||||
var xpathResult = this.evaluateXPath(
|
||||
@ -879,8 +875,7 @@ var TreeStyleTabService = {
|
||||
{
|
||||
if (!aTab) return -1;
|
||||
|
||||
var b = this.getTabBrowserFromChild(aTab) || this.browser;
|
||||
if (b.getAttribute(this.kALLOW_COLLAPSE) != 'true')
|
||||
if (!this.canCollapseSubtree(aTab))
|
||||
return this.getTabIndex(aTab);
|
||||
|
||||
return aTab.getAttribute(this.kCOLLAPSED) == 'true' ?
|
||||
@ -904,12 +899,15 @@ var TreeStyleTabService = {
|
||||
);
|
||||
},
|
||||
|
||||
canCollapseSubtree : function(aTabBrowser) /* PUBLIC API */
|
||||
{
|
||||
var b = this.getTabBrowserFromChild(aTabBrowser) || this.browser;
|
||||
return b.getAttribute(this.kALLOW_COLLAPSE) == 'true';
|
||||
},
|
||||
|
||||
isCollapsed : function(aTab) /* PUBLIC API */
|
||||
{
|
||||
if (!aTab) return false;
|
||||
|
||||
var b = this.getTabBrowserFromChild(aTab) || this.browser;
|
||||
if (b.getAttribute(this.kALLOW_COLLAPSE) == 'true')
|
||||
if (!aTab || !this.canCollapseSubtree(aTab))
|
||||
return false;
|
||||
|
||||
return aTab.getAttribute(this.kCOLLAPSED) == 'true';
|
||||
@ -917,10 +915,7 @@ var TreeStyleTabService = {
|
||||
|
||||
isSubtreeCollapsed : function(aTab) /* PUBLIC API */
|
||||
{
|
||||
if (!aTab) return false;
|
||||
|
||||
var b = this.getTabBrowserFromChild(aTab) || this.browser;
|
||||
if (b.getAttribute(this.kALLOW_COLLAPSE) == 'true')
|
||||
if (!aTab || !this.canCollapseSubtree(aTab))
|
||||
return false;
|
||||
|
||||
return aTab.getAttribute(this.kSUBTREE_COLLAPSED) == 'true';
|
||||
@ -1122,10 +1117,9 @@ var TreeStyleTabService = {
|
||||
|
||||
getXOffsetOfTab : function(aTab)
|
||||
{
|
||||
var extraCondition = '';
|
||||
var b = this.getTabBrowserFromChild(aTab) || this.browser;
|
||||
if (b.getAttribute(this.kALLOW_COLLAPSE) == 'true')
|
||||
extraCondition = '[not(@'+this.kCOLLAPSED+'="true")]';
|
||||
var extraCondition = this.canCollapseSubtree(aTab) ?
|
||||
'[not(@'+this.kCOLLAPSED+'="true")]' :
|
||||
'' ;
|
||||
|
||||
return this.evaluateXPath(
|
||||
'sum((self::* | preceding-sibling::xul:tab'+extraCondition+')/attribute::'+this.kX_OFFSET+')',
|
||||
@ -1135,10 +1129,9 @@ var TreeStyleTabService = {
|
||||
},
|
||||
getYOffsetOfTab : function(aTab)
|
||||
{
|
||||
var extraCondition = '';
|
||||
var b = this.getTabBrowserFromChild(aTab) || this.browser;
|
||||
if (b.getAttribute(this.kALLOW_COLLAPSE) == 'true')
|
||||
extraCondition = '[not(@'+this.kCOLLAPSED+'="true")]';
|
||||
var extraCondition = this.canCollapseSubtree(aTab) ?
|
||||
'[not(@'+this.kCOLLAPSED+'="true")]' :
|
||||
'';
|
||||
|
||||
return this.evaluateXPath(
|
||||
'sum((self::* | preceding-sibling::xul:tab'+extraCondition+')/attribute::'+this.kY_OFFSET+')',
|
||||
|
@ -223,7 +223,7 @@ TreeStyleTabBrowser.prototype = {
|
||||
<![CDATA[$&
|
||||
var treeStyleTab = TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab;
|
||||
treeStyleTab._focusChangedByShortcut = TreeStyleTabService.accelKeyPressed;
|
||||
if (treeStyleTab.browser.getAttribute(treeStyleTab.kALLOW_COLLAPSE) == 'true' &&
|
||||
if (treeStyleTab.canCollapseSubtree() &&
|
||||
treeStyleTab.getTreePref('focusMode') == treeStyleTab.kFOCUS_VISIBLE) {
|
||||
(function(aDir, aWrap, aSelf) {
|
||||
var nextTab = (aDir < 0) ? treeStyleTab.getPreviousVisibleTab(aSelf.selectedItem) : treeStyleTab.getNextVisibleTab(aSelf.selectedItem) ;
|
||||
@ -2071,8 +2071,7 @@ TreeStyleTabBrowser.prototype = {
|
||||
|
||||
if (this.isEventFiredOnTwisty(aEvent)) {
|
||||
var tab = this.getTabFromEvent(aEvent);
|
||||
if (this.hasChildTabs(tab) &&
|
||||
this.mTabBrowser.getAttribute(this.kALLOW_COLLAPSE) == 'true') {
|
||||
if (this.hasChildTabs(tab) && this.canCollapseSubtree()) {
|
||||
this.collapseExpandSubtree(tab, tab.getAttribute(this.kSUBTREE_COLLAPSED) != 'true');
|
||||
aEvent.preventDefault();
|
||||
aEvent.stopPropagation();
|
||||
@ -2218,7 +2217,7 @@ TreeStyleTabBrowser.prototype = {
|
||||
).singleNodeValue;
|
||||
let collapseItem = items[this.kMENUITEM_COLLAPSE];
|
||||
let expanndItem = items[this.kMENUITEM_EXPAND];
|
||||
if (b.getAttribute(this.kALLOW_COLLAPSE) == 'true' &&
|
||||
if (this.canCollapseSubtree(b) &&
|
||||
this.evaluateXPath(
|
||||
'child::xul:tab[@'+this.kCHILDREN+']',
|
||||
b.mTabContainer
|
||||
@ -3285,7 +3284,7 @@ TreeStyleTabBrowser.prototype = {
|
||||
aJustNow ||
|
||||
this.collapseDuration < 1 ||
|
||||
// !this.isVertical ||
|
||||
this.mTabBrowser.getAttribute(this.kALLOW_COLLAPSE) != 'true'
|
||||
!this.canCollapseSubtree()
|
||||
) {
|
||||
aTab.setAttribute(
|
||||
'style',
|
||||
@ -3421,11 +3420,12 @@ TreeStyleTabBrowser.prototype = {
|
||||
|
||||
collapseExpandTreesIntelligentlyFor : function(aTab, aJustNow)
|
||||
{
|
||||
if (!aTab || this.doingCollapseExpand) return;
|
||||
if (!aTab ||
|
||||
this.doingCollapseExpand ||
|
||||
!this.canCollapseSubtree())
|
||||
return;
|
||||
|
||||
var b = this.mTabBrowser;
|
||||
if (b.getAttribute(this.kALLOW_COLLAPSE) != 'true') return;
|
||||
|
||||
var sameParentTab = this.getParentTab(aTab);
|
||||
var expandedParentTabs = [
|
||||
aTab.getAttribute(this.kID)
|
||||
|
Loading…
Reference in New Issue
Block a user