Fossil SCM

Improvements to tooltip behavior in an effort to make it easier to move the mouse over to the "copy button" or to the hyperlink without the tooltip changing out from under the user.

drh 2019-06-08 14:48 trunk
Commit 55f56e91badb50ce8a2b874e7f43fbb57f7706d84be0a992e35209377fc37ba5
1 file changed +10 -2
+10 -2
--- src/graph.js
+++ src/graph.js
@@ -61,11 +61,10 @@
6161
** merges.
6262
** ci: "cherrypick-in". Like "mi" except for cherrypick merges.
6363
** omitted if there are no cherrypick merges.
6464
** h: The artifact hash of the object being graphed
6565
*/
66
-
6766
/* The amendCss() function does a one-time change to the CSS to account
6867
** for the "circleNodes" and "showArrowheads" settings. Do this change
6968
** only once, even if there are multiple graphs being rendered.
7069
*/
7170
var amendCssOnce = 1; // Only change the CSS one time
@@ -89,11 +88,20 @@
8988
/* The <span> object that holds the tooltip */
9089
var tooltipObj = document.createElement("span");
9190
tooltipObj.className = "tl-tooltip";
9291
tooltipObj.style.display = "none";
9392
document.getElementsByClassName("content")[0].appendChild(tooltipObj);
94
-tooltipObj.onmouseenter = function(){stopCloseTimer();}
93
+tooltipObj.onmouseenter = function(){
94
+ /* Hold the tooltip constant as long as the mouse is over the tooltip.
95
+ ** In other words, do not let any of the timers changes the tooltip while
96
+ ** the mouse is directly over the tooltip. This makes it easier for the
97
+ ** user to move over top of the "copy-button" or the hyperlink to the
98
+ ** /info page. */
99
+ stopCloseTimer();
100
+ stopDwellTimer();
101
+ tooltipInfo.ixHover = tooltipInfo.ixActive;
102
+}
95103
tooltipObj.onmouseleave = function(){
96104
if (tooltipInfo.ixActive != -1) resumeCloseTimer();
97105
};
98106
99107
/* State information for the tooltip popup and its timers */
100108
--- src/graph.js
+++ src/graph.js
@@ -61,11 +61,10 @@
61 ** merges.
62 ** ci: "cherrypick-in". Like "mi" except for cherrypick merges.
63 ** omitted if there are no cherrypick merges.
64 ** h: The artifact hash of the object being graphed
65 */
66
67 /* The amendCss() function does a one-time change to the CSS to account
68 ** for the "circleNodes" and "showArrowheads" settings. Do this change
69 ** only once, even if there are multiple graphs being rendered.
70 */
71 var amendCssOnce = 1; // Only change the CSS one time
@@ -89,11 +88,20 @@
89 /* The <span> object that holds the tooltip */
90 var tooltipObj = document.createElement("span");
91 tooltipObj.className = "tl-tooltip";
92 tooltipObj.style.display = "none";
93 document.getElementsByClassName("content")[0].appendChild(tooltipObj);
94 tooltipObj.onmouseenter = function(){stopCloseTimer();}
 
 
 
 
 
 
 
 
 
95 tooltipObj.onmouseleave = function(){
96 if (tooltipInfo.ixActive != -1) resumeCloseTimer();
97 };
98
99 /* State information for the tooltip popup and its timers */
100
--- src/graph.js
+++ src/graph.js
@@ -61,11 +61,10 @@
61 ** merges.
62 ** ci: "cherrypick-in". Like "mi" except for cherrypick merges.
63 ** omitted if there are no cherrypick merges.
64 ** h: The artifact hash of the object being graphed
65 */
 
66 /* The amendCss() function does a one-time change to the CSS to account
67 ** for the "circleNodes" and "showArrowheads" settings. Do this change
68 ** only once, even if there are multiple graphs being rendered.
69 */
70 var amendCssOnce = 1; // Only change the CSS one time
@@ -89,11 +88,20 @@
88 /* The <span> object that holds the tooltip */
89 var tooltipObj = document.createElement("span");
90 tooltipObj.className = "tl-tooltip";
91 tooltipObj.style.display = "none";
92 document.getElementsByClassName("content")[0].appendChild(tooltipObj);
93 tooltipObj.onmouseenter = function(){
94 /* Hold the tooltip constant as long as the mouse is over the tooltip.
95 ** In other words, do not let any of the timers changes the tooltip while
96 ** the mouse is directly over the tooltip. This makes it easier for the
97 ** user to move over top of the "copy-button" or the hyperlink to the
98 ** /info page. */
99 stopCloseTimer();
100 stopDwellTimer();
101 tooltipInfo.ixHover = tooltipInfo.ixActive;
102 }
103 tooltipObj.onmouseleave = function(){
104 if (tooltipInfo.ixActive != -1) resumeCloseTimer();
105 };
106
107 /* State information for the tooltip popup and its timers */
108

Keyboard Shortcuts

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