twisty上のツールチップは常にツリー全体のラベルを表示

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4860 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-07-31 07:10:30 +00:00
parent 8ef4ae0f9b
commit 00dab2f8a0

View File

@ -2217,9 +2217,8 @@ catch(e) {
var label;
var collapsed = aTab.getAttribute(this.kSUBTREE_COLLAPSED) == 'true';
if (collapsed) {
let base = parseInt(aTab.getAttribute(this.kNEST) || 0);
label = [aTab].concat(this.getDescendantTabs(aTab))
var base = parseInt(aTab.getAttribute(this.kNEST) || 0);
var tree = [aTab].concat(this.getDescendantTabs(aTab))
.map(function(aTab) {
let label = '* '+aTab.getAttribute('label');
let nest = parseInt(aTab.getAttribute(this.kNEST) || 0) - base;
@ -2230,17 +2229,19 @@ catch(e) {
return label;
}, this)
.join('\n');
}
if (aTab.getAttribute(this.kTWISTY_HOVER) == 'true') {
let key = collapsed ?
'tooltip.expandSubtree' :
'tooltip.collapseSubtree' ;
label = label || aTab.getAttribute('label');
label = tree || aTab.getAttribute('label');
label = label ?
this.stringbundle.getFormattedString(key+'.labeled', [label]) :
this.stringbundle.getString(key) ;
}
else if (collapsed) {
label = tree;
}
if (label)
aEvent.target.setAttribute('label', label);