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.
Commit
55f56e91badb50ce8a2b874e7f43fbb57f7706d84be0a992e35209377fc37ba5
Parent
786d6167fa008d1…
1 file changed
+10
-2
+10
-2
| --- src/graph.js | ||
| +++ src/graph.js | ||
| @@ -61,11 +61,10 @@ | ||
| 61 | 61 | ** merges. |
| 62 | 62 | ** ci: "cherrypick-in". Like "mi" except for cherrypick merges. |
| 63 | 63 | ** omitted if there are no cherrypick merges. |
| 64 | 64 | ** h: The artifact hash of the object being graphed |
| 65 | 65 | */ |
| 66 | - | |
| 67 | 66 | /* The amendCss() function does a one-time change to the CSS to account |
| 68 | 67 | ** for the "circleNodes" and "showArrowheads" settings. Do this change |
| 69 | 68 | ** only once, even if there are multiple graphs being rendered. |
| 70 | 69 | */ |
| 71 | 70 | var amendCssOnce = 1; // Only change the CSS one time |
| @@ -89,11 +88,20 @@ | ||
| 89 | 88 | /* The <span> object that holds the tooltip */ |
| 90 | 89 | var tooltipObj = document.createElement("span"); |
| 91 | 90 | tooltipObj.className = "tl-tooltip"; |
| 92 | 91 | tooltipObj.style.display = "none"; |
| 93 | 92 | 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 | +} | |
| 95 | 103 | tooltipObj.onmouseleave = function(){ |
| 96 | 104 | if (tooltipInfo.ixActive != -1) resumeCloseTimer(); |
| 97 | 105 | }; |
| 98 | 106 | |
| 99 | 107 | /* State information for the tooltip popup and its timers */ |
| 100 | 108 |
| --- 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 |