Fossil SCM

Make the "click to show tooltip" action more "discoverable" with a changing mouse cursor, similar to the timeline nodes. This example uses the "pointer" cursor, but the "help" cursor may also be an option.

florian 2019-05-20 08:14 tooltips
Commit 8b8eaad864c55212716d6627bd64f55d4678533c7b105e017f8300ce05b736e4
1 file changed +5
--- src/graph.js
+++ src/graph.js
@@ -83,10 +83,15 @@
8383
function TimelineGraph(tx){
8484
var topObj = document.getElementById("timelineTable"+tx.iTableId);
8585
amendCss(tx.circleNodes, tx.showArrowheads);
8686
topObj.onclick = clickOnGraph
8787
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
+ };
8893
var canvasDiv;
8994
var railPitch;
9095
var mergeOffset;
9196
var node, arrow, arrowSmall, line, mArrow, mLine, wArrow, wLine;
9297
9398
--- src/graph.js
+++ src/graph.js
@@ -83,10 +83,15 @@
83 function TimelineGraph(tx){
84 var topObj = document.getElementById("timelineTable"+tx.iTableId);
85 amendCss(tx.circleNodes, tx.showArrowheads);
86 topObj.onclick = clickOnGraph
87 topObj.ondblclick = dblclickOnGraph
 
 
 
 
 
88 var canvasDiv;
89 var railPitch;
90 var mergeOffset;
91 var node, arrow, arrowSmall, line, mArrow, mLine, wArrow, wLine;
92
93
--- src/graph.js
+++ src/graph.js
@@ -83,10 +83,15 @@
83 function TimelineGraph(tx){
84 var topObj = document.getElementById("timelineTable"+tx.iTableId);
85 amendCss(tx.circleNodes, tx.showArrowheads);
86 topObj.onclick = clickOnGraph
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
98

Keyboard Shortcuts

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