Fossil SCM

Hide the tooltip if the mouse is outside the current timeline table, and outside the tooltip itself.

florian 2019-05-20 08:19 tooltip-experiments
Commit bd803b06267b1a77dd4aa8d3597482319d122ec3e3033cbc58c6419d8df39d1c
1 file changed +9
--- src/graph.js
+++ src/graph.js
@@ -87,10 +87,19 @@
8787
topObj.ondblclick = dblclickOnGraph
8888
topObj.onmousemove = function(e) {
8989
var ix = findTxIndex(e);
9090
var cursor = (ix<0) ? "" : "pointer"; /* Or: cursor = "help"? */
9191
document.getElementsByTagName('body')[0].style.cursor = cursor;
92
+ };
93
+ topObj.onmouseleave = function(e) {
94
+ /* Hide the tooltip if the mouse is outside the "timelineTableN" element,
95
+ ** and outside the tooltip. */
96
+ if (tooltipObj.style.display != "none" &&
97
+ e.relatedTarget &&
98
+ e.relatedTarget != tooltipObj) {
99
+ tooltipObj.style.display = "none";
100
+ }
92101
};
93102
var canvasDiv;
94103
var railPitch;
95104
var mergeOffset;
96105
var node, arrow, arrowSmall, line, mArrow, mLine, wArrow, wLine;
97106
--- src/graph.js
+++ src/graph.js
@@ -87,10 +87,19 @@
87 topObj.ondblclick = dblclickOnGraph
88 topObj.onmousemove = function(e) {
89 var ix = findTxIndex(e);
90 var cursor = (ix<0) ? "" : "pointer"; /* Or: cursor = "help"? */
91 document.getElementsByTagName('body')[0].style.cursor = cursor;
 
 
 
 
 
 
 
 
 
92 };
93 var canvasDiv;
94 var railPitch;
95 var mergeOffset;
96 var node, arrow, arrowSmall, line, mArrow, mLine, wArrow, wLine;
97
--- src/graph.js
+++ src/graph.js
@@ -87,10 +87,19 @@
87 topObj.ondblclick = dblclickOnGraph
88 topObj.onmousemove = function(e) {
89 var ix = findTxIndex(e);
90 var cursor = (ix<0) ? "" : "pointer"; /* Or: cursor = "help"? */
91 document.getElementsByTagName('body')[0].style.cursor = cursor;
92 };
93 topObj.onmouseleave = function(e) {
94 /* Hide the tooltip if the mouse is outside the "timelineTableN" element,
95 ** and outside the tooltip. */
96 if (tooltipObj.style.display != "none" &&
97 e.relatedTarget &&
98 e.relatedTarget != tooltipObj) {
99 tooltipObj.style.display = "none";
100 }
101 };
102 var canvasDiv;
103 var railPitch;
104 var mergeOffset;
105 var node, arrow, arrowSmall, line, mArrow, mLine, wArrow, wLine;
106

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button