Don't show full tooltip if TST's tooltip is disabled by user preference (#268)

This commit is contained in:
SHIMODA Hiroshi 2012-04-09 21:28:48 +09:00
parent 7a0a8661fd
commit 3792c8a239

View File

@ -305,11 +305,12 @@ FullTooltipManager.prototype = {
}
}
var shouldShowTree = mode != this.kTOOLTIP_MODE_DEFAULT && (collapsed || mode == this.kTOOLTIP_MODE_ALWAYS);
if ('mOverCloseButton' in tab && tab.mOverCloseButton) {
if (descendant.length &&
(collapsed || this.getTreePref('closeParentBehavior') == this.kCLOSE_PARENT_BEHAVIOR_CLOSE_ALL_CHILDREN)) {
label = tree || tab.getAttribute('label');
label = label ?
label = label && shouldShowTree ?
this.treeBundle.getFormattedString('tooltip.closeTree.labeled', [label]) :
this.treeBundle.getString('tooltip.closeTree') ;
fullTooltipExtraLabel = this.treeBundle.getFormattedString('tooltip.closeTree.labeled', ['%TREE%']).split(/\s*%TREE%\s*/);
@ -320,12 +321,12 @@ FullTooltipManager.prototype = {
'tooltip.expandSubtree' :
'tooltip.collapseSubtree' ;
label = tree || tab.getAttribute('label');
label = label ?
label = label && shouldShowTree ?
this.treeBundle.getFormattedString(key+'.labeled', [label]) :
this.treeBundle.getString(key) ;
fullTooltipExtraLabel = this.treeBundle.getFormattedString(key+'.labeled', ['%TREE%']).split(/\s*%TREE%\s*/);
}
else if (collapsed || mode == this.kTOOLTIP_MODE_ALWAYS) {
else if (shouldShowTree) {
label = tree;
}
@ -335,6 +336,7 @@ FullTooltipManager.prototype = {
aEvent.target.setAttribute('label', label);
aEvent.stopPropagation();
if (shouldShowTree)
this.setup(aEvent.target, tab, fullTooltipExtraLabel);
},