Skip to content

Commit

Permalink
Remove tooltip when leaving tree node
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Rossi committed Dec 25, 2015
1 parent ece5024 commit 6c6000b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/webapp/resources/net/apachegui/ConfigurationTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,13 +572,17 @@ define([
var id = 'tooltipDialog-' + that._getItemProperty(item, 'id');

var tooltipDialog = that.tooltipDialogs[id] || null;
var inTooltip = false;
if(tooltipDialog == null) {
tooltipDialog = new TooltipDialog({
id: id,
style: "width: auto;",
content: '<a target="_blank" href="Configuration.jsp?file=' + file + '&lineNum=' + lineNumber + '">' + file + '</a> Line: ' + lineNumber,
onMouseLeave: function(){
popup.close(tooltipDialog);
},
onMouseEnter: function(){
inTooltip = true;
}
});

Expand All @@ -588,12 +592,20 @@ define([
var leaveTimer = setTimeout(function() {
popup.open({
popup: tooltipDialog,
around: node
around: node,
onCancel: function(){
popup.close(tooltipDialog);
}
});
}, 750);

on.once(node, 'mouseleave', function() {
clearTimeout(leaveTimer);
setTimeout(function() {
if(!inTooltip) {
popup.close(tooltipDialog);
}
}, 500);
});
}
});
Expand Down

0 comments on commit 6c6000b

Please sign in to comment.