クローズボックスの上でのツールチップもオーバーライド

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4872 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-07-31 10:09:11 +00:00
parent 45020bb769
commit 1984e64c09
2 changed files with 25 additions and 4 deletions

View File

@ -540,6 +540,18 @@ var TreeStyleTabService = {
},
expandTwistyArea : true,
isEventFiredOnClosebox : function(aEvent)
{
var tab = this.getTabFromEvent(aEvent);
if (!tab || !this.hasChildTabs(tab)) return false;
return this.evaluateXPath(
'ancestor-or-self::*[contains(concat(" ", normalize-space(@class), " "), " tab-close-button ")]',
aEvent.originalTarget || aEvent.target,
XPathResult.BOOLEAN_TYPE
).booleanValue;
},
isEventFiredOnClickable : function(aEvent)
{
return this.evaluateXPath(
@ -2201,7 +2213,16 @@ catch(e) {
}, this)
.join('\n');
if (aTab.getAttribute(this.kTWISTY_HOVER) == 'true') {
if ('mOverCloseButton' in aTab && aTab.mOverCloseButton) {
if (
collapsed ||
this.getTreePref('closeParentBehavior') == this.CLOSE_PARENT_BEHAVIOR_CLOSE
) {
// Close This Tree
label = document.getElementById('context-item-removeTabSubTree').label;
}
}
else if (aTab.getAttribute(this.kTWISTY_HOVER) == 'true') {
let key = collapsed ?
'tooltip.expandSubtree' :
'tooltip.collapseSubtree' ;

View File

@ -409,12 +409,12 @@ TreeStyleTabBrowser.prototype = {
eval('b.createTooltip = '+
b.createTooltip.toSource().replace(
'if (tn.hasAttribute("label")) {',
'if ("mOverCloseButton" in tn && tn.mOverCloseButton) {',
<![CDATA[
else if (TreeStyleTabService.getTabBrowserFromChild(tn).treeStyleTab.handleTooltip(event, tn)) {
if (TreeStyleTabService.getTabBrowserFromChild(tn).treeStyleTab.handleTooltip(event, tn)) {
return true;
}
$&]]>
else $&]]>
)
);