Fossil SCM

Cherry-pick [ac199e7a8a]: Explicitly query the client mouse coordinates, to fix the positioning of tooltips for nodes in IE.

florian 2019-05-28 12:31 tooltip-copyhash
Commit 3b5e74c4ca657d331c864171046b8e09606fb29808d698ed874c4b4ac2dffbf5
2 files changed +8 -8 +8 -8
+8 -8
--- src/graph.js
+++ src/graph.js
@@ -158,12 +158,12 @@
158158
** element, so clear the dwell timer, and record the new element id and
159159
** mouse position. */
160160
stopDwellTimer();
161161
if(ix >= 0){
162162
tooltipInfo.ixHover = ix;
163
- tooltipInfo.posX = e.x;
164
- tooltipInfo.posY = e.y;
163
+ tooltipInfo.posX = e.clientX;
164
+ tooltipInfo.posY = e.clientY;
165165
stopCloseTimer();
166166
if(tooltipInfo.dwellTimeout>0){
167167
tooltipInfo.idTimer = setTimeout(function() {
168168
tooltipInfo.idTimer = 0;
169169
stopCloseTimer();
@@ -189,12 +189,12 @@
189189
function nodeHover(e){
190190
/* Invoked by mousemove events over a graph node */
191191
e.stopPropagation()
192192
if(tooltipInfo.ixHover==-2) return
193193
tooltipInfo.ixHover = -2
194
- tooltipInfo.posX = e.x
195
- tooltipInfo.posY = e.y
194
+ tooltipInfo.posX = e.clientX
195
+ tooltipInfo.posY = e.clientY
196196
tooltipInfo.nodeHover = this
197197
stopCloseTimer();
198198
if(tooltipInfo.dwellTimeout>0){
199199
tooltipInfo.idTimer = setTimeout(function() {
200200
tooltipInfo.idTimer = 0;
@@ -558,12 +558,12 @@
558558
}
559559
function findTxIndex(e){
560560
/* Look at all the graph elements. If any graph elements that is near
561561
** the click-point "e" and has a "data-ix" attribute, then return
562562
** the value of that attribute. Otherwise return -1 */
563
- var x = e.x + window.pageXOffset - absoluteX(canvasDiv);
564
- var y = e.y + window.pageYOffset - absoluteY(canvasDiv);
563
+ var x = e.clientX + window.pageXOffset - absoluteX(canvasDiv);
564
+ var y = e.clientY + window.pageYOffset - absoluteY(canvasDiv);
565565
var aNode = canvasDiv.childNodes
566566
var nNode = aNode.length;
567567
var i;
568568
for(i=0;i<nNode;i++){
569569
var n = aNode[i]
@@ -584,12 +584,12 @@
584584
dest += encodeURIComponent(tx.rowinfo[ix].h)
585585
return dest
586586
}
587587
function clickOnGraph(e){
588588
tooltipInfo.ixHover = findTxIndex(e);
589
- tooltipInfo.posX = e.x;
590
- tooltipInfo.posY = e.y;
589
+ tooltipInfo.posX = e.clientX;
590
+ tooltipInfo.posY = e.clientY;
591591
showGraphTooltip();
592592
}
593593
function showGraphTooltip(){
594594
var html = null
595595
var ix = -1
596596
--- src/graph.js
+++ src/graph.js
@@ -158,12 +158,12 @@
158 ** element, so clear the dwell timer, and record the new element id and
159 ** mouse position. */
160 stopDwellTimer();
161 if(ix >= 0){
162 tooltipInfo.ixHover = ix;
163 tooltipInfo.posX = e.x;
164 tooltipInfo.posY = e.y;
165 stopCloseTimer();
166 if(tooltipInfo.dwellTimeout>0){
167 tooltipInfo.idTimer = setTimeout(function() {
168 tooltipInfo.idTimer = 0;
169 stopCloseTimer();
@@ -189,12 +189,12 @@
189 function nodeHover(e){
190 /* Invoked by mousemove events over a graph node */
191 e.stopPropagation()
192 if(tooltipInfo.ixHover==-2) return
193 tooltipInfo.ixHover = -2
194 tooltipInfo.posX = e.x
195 tooltipInfo.posY = e.y
196 tooltipInfo.nodeHover = this
197 stopCloseTimer();
198 if(tooltipInfo.dwellTimeout>0){
199 tooltipInfo.idTimer = setTimeout(function() {
200 tooltipInfo.idTimer = 0;
@@ -558,12 +558,12 @@
558 }
559 function findTxIndex(e){
560 /* Look at all the graph elements. If any graph elements that is near
561 ** the click-point "e" and has a "data-ix" attribute, then return
562 ** the value of that attribute. Otherwise return -1 */
563 var x = e.x + window.pageXOffset - absoluteX(canvasDiv);
564 var y = e.y + window.pageYOffset - absoluteY(canvasDiv);
565 var aNode = canvasDiv.childNodes
566 var nNode = aNode.length;
567 var i;
568 for(i=0;i<nNode;i++){
569 var n = aNode[i]
@@ -584,12 +584,12 @@
584 dest += encodeURIComponent(tx.rowinfo[ix].h)
585 return dest
586 }
587 function clickOnGraph(e){
588 tooltipInfo.ixHover = findTxIndex(e);
589 tooltipInfo.posX = e.x;
590 tooltipInfo.posY = e.y;
591 showGraphTooltip();
592 }
593 function showGraphTooltip(){
594 var html = null
595 var ix = -1
596
--- src/graph.js
+++ src/graph.js
@@ -158,12 +158,12 @@
158 ** element, so clear the dwell timer, and record the new element id and
159 ** mouse position. */
160 stopDwellTimer();
161 if(ix >= 0){
162 tooltipInfo.ixHover = ix;
163 tooltipInfo.posX = e.clientX;
164 tooltipInfo.posY = e.clientY;
165 stopCloseTimer();
166 if(tooltipInfo.dwellTimeout>0){
167 tooltipInfo.idTimer = setTimeout(function() {
168 tooltipInfo.idTimer = 0;
169 stopCloseTimer();
@@ -189,12 +189,12 @@
189 function nodeHover(e){
190 /* Invoked by mousemove events over a graph node */
191 e.stopPropagation()
192 if(tooltipInfo.ixHover==-2) return
193 tooltipInfo.ixHover = -2
194 tooltipInfo.posX = e.clientX
195 tooltipInfo.posY = e.clientY
196 tooltipInfo.nodeHover = this
197 stopCloseTimer();
198 if(tooltipInfo.dwellTimeout>0){
199 tooltipInfo.idTimer = setTimeout(function() {
200 tooltipInfo.idTimer = 0;
@@ -558,12 +558,12 @@
558 }
559 function findTxIndex(e){
560 /* Look at all the graph elements. If any graph elements that is near
561 ** the click-point "e" and has a "data-ix" attribute, then return
562 ** the value of that attribute. Otherwise return -1 */
563 var x = e.clientX + window.pageXOffset - absoluteX(canvasDiv);
564 var y = e.clientY + window.pageYOffset - absoluteY(canvasDiv);
565 var aNode = canvasDiv.childNodes
566 var nNode = aNode.length;
567 var i;
568 for(i=0;i<nNode;i++){
569 var n = aNode[i]
@@ -584,12 +584,12 @@
584 dest += encodeURIComponent(tx.rowinfo[ix].h)
585 return dest
586 }
587 function clickOnGraph(e){
588 tooltipInfo.ixHover = findTxIndex(e);
589 tooltipInfo.posX = e.clientX;
590 tooltipInfo.posY = e.clientY;
591 showGraphTooltip();
592 }
593 function showGraphTooltip(){
594 var html = null
595 var ix = -1
596
+8 -8
--- src/graph.js
+++ src/graph.js
@@ -158,12 +158,12 @@
158158
** element, so clear the dwell timer, and record the new element id and
159159
** mouse position. */
160160
stopDwellTimer();
161161
if(ix >= 0){
162162
tooltipInfo.ixHover = ix;
163
- tooltipInfo.posX = e.x;
164
- tooltipInfo.posY = e.y;
163
+ tooltipInfo.posX = e.clientX;
164
+ tooltipInfo.posY = e.clientY;
165165
stopCloseTimer();
166166
if(tooltipInfo.dwellTimeout>0){
167167
tooltipInfo.idTimer = setTimeout(function() {
168168
tooltipInfo.idTimer = 0;
169169
stopCloseTimer();
@@ -189,12 +189,12 @@
189189
function nodeHover(e){
190190
/* Invoked by mousemove events over a graph node */
191191
e.stopPropagation()
192192
if(tooltipInfo.ixHover==-2) return
193193
tooltipInfo.ixHover = -2
194
- tooltipInfo.posX = e.x
195
- tooltipInfo.posY = e.y
194
+ tooltipInfo.posX = e.clientX
195
+ tooltipInfo.posY = e.clientY
196196
tooltipInfo.nodeHover = this
197197
stopCloseTimer();
198198
if(tooltipInfo.dwellTimeout>0){
199199
tooltipInfo.idTimer = setTimeout(function() {
200200
tooltipInfo.idTimer = 0;
@@ -558,12 +558,12 @@
558558
}
559559
function findTxIndex(e){
560560
/* Look at all the graph elements. If any graph elements that is near
561561
** the click-point "e" and has a "data-ix" attribute, then return
562562
** the value of that attribute. Otherwise return -1 */
563
- var x = e.x + window.pageXOffset - absoluteX(canvasDiv);
564
- var y = e.y + window.pageYOffset - absoluteY(canvasDiv);
563
+ var x = e.clientX + window.pageXOffset - absoluteX(canvasDiv);
564
+ var y = e.clientY + window.pageYOffset - absoluteY(canvasDiv);
565565
var aNode = canvasDiv.childNodes
566566
var nNode = aNode.length;
567567
var i;
568568
for(i=0;i<nNode;i++){
569569
var n = aNode[i]
@@ -584,12 +584,12 @@
584584
dest += encodeURIComponent(tx.rowinfo[ix].h)
585585
return dest
586586
}
587587
function clickOnGraph(e){
588588
tooltipInfo.ixHover = findTxIndex(e);
589
- tooltipInfo.posX = e.x;
590
- tooltipInfo.posY = e.y;
589
+ tooltipInfo.posX = e.clientX;
590
+ tooltipInfo.posY = e.clientY;
591591
showGraphTooltip();
592592
}
593593
function showGraphTooltip(){
594594
var html = null
595595
var ix = -1
596596
--- src/graph.js
+++ src/graph.js
@@ -158,12 +158,12 @@
158 ** element, so clear the dwell timer, and record the new element id and
159 ** mouse position. */
160 stopDwellTimer();
161 if(ix >= 0){
162 tooltipInfo.ixHover = ix;
163 tooltipInfo.posX = e.x;
164 tooltipInfo.posY = e.y;
165 stopCloseTimer();
166 if(tooltipInfo.dwellTimeout>0){
167 tooltipInfo.idTimer = setTimeout(function() {
168 tooltipInfo.idTimer = 0;
169 stopCloseTimer();
@@ -189,12 +189,12 @@
189 function nodeHover(e){
190 /* Invoked by mousemove events over a graph node */
191 e.stopPropagation()
192 if(tooltipInfo.ixHover==-2) return
193 tooltipInfo.ixHover = -2
194 tooltipInfo.posX = e.x
195 tooltipInfo.posY = e.y
196 tooltipInfo.nodeHover = this
197 stopCloseTimer();
198 if(tooltipInfo.dwellTimeout>0){
199 tooltipInfo.idTimer = setTimeout(function() {
200 tooltipInfo.idTimer = 0;
@@ -558,12 +558,12 @@
558 }
559 function findTxIndex(e){
560 /* Look at all the graph elements. If any graph elements that is near
561 ** the click-point "e" and has a "data-ix" attribute, then return
562 ** the value of that attribute. Otherwise return -1 */
563 var x = e.x + window.pageXOffset - absoluteX(canvasDiv);
564 var y = e.y + window.pageYOffset - absoluteY(canvasDiv);
565 var aNode = canvasDiv.childNodes
566 var nNode = aNode.length;
567 var i;
568 for(i=0;i<nNode;i++){
569 var n = aNode[i]
@@ -584,12 +584,12 @@
584 dest += encodeURIComponent(tx.rowinfo[ix].h)
585 return dest
586 }
587 function clickOnGraph(e){
588 tooltipInfo.ixHover = findTxIndex(e);
589 tooltipInfo.posX = e.x;
590 tooltipInfo.posY = e.y;
591 showGraphTooltip();
592 }
593 function showGraphTooltip(){
594 var html = null
595 var ix = -1
596
--- src/graph.js
+++ src/graph.js
@@ -158,12 +158,12 @@
158 ** element, so clear the dwell timer, and record the new element id and
159 ** mouse position. */
160 stopDwellTimer();
161 if(ix >= 0){
162 tooltipInfo.ixHover = ix;
163 tooltipInfo.posX = e.clientX;
164 tooltipInfo.posY = e.clientY;
165 stopCloseTimer();
166 if(tooltipInfo.dwellTimeout>0){
167 tooltipInfo.idTimer = setTimeout(function() {
168 tooltipInfo.idTimer = 0;
169 stopCloseTimer();
@@ -189,12 +189,12 @@
189 function nodeHover(e){
190 /* Invoked by mousemove events over a graph node */
191 e.stopPropagation()
192 if(tooltipInfo.ixHover==-2) return
193 tooltipInfo.ixHover = -2
194 tooltipInfo.posX = e.clientX
195 tooltipInfo.posY = e.clientY
196 tooltipInfo.nodeHover = this
197 stopCloseTimer();
198 if(tooltipInfo.dwellTimeout>0){
199 tooltipInfo.idTimer = setTimeout(function() {
200 tooltipInfo.idTimer = 0;
@@ -558,12 +558,12 @@
558 }
559 function findTxIndex(e){
560 /* Look at all the graph elements. If any graph elements that is near
561 ** the click-point "e" and has a "data-ix" attribute, then return
562 ** the value of that attribute. Otherwise return -1 */
563 var x = e.clientX + window.pageXOffset - absoluteX(canvasDiv);
564 var y = e.clientY + window.pageYOffset - absoluteY(canvasDiv);
565 var aNode = canvasDiv.childNodes
566 var nNode = aNode.length;
567 var i;
568 for(i=0;i<nNode;i++){
569 var n = aNode[i]
@@ -584,12 +584,12 @@
584 dest += encodeURIComponent(tx.rowinfo[ix].h)
585 return dest
586 }
587 function clickOnGraph(e){
588 tooltipInfo.ixHover = findTxIndex(e);
589 tooltipInfo.posX = e.clientX;
590 tooltipInfo.posY = e.clientY;
591 showGraphTooltip();
592 }
593 function showGraphTooltip(){
594 var html = null
595 var ix = -1
596

Keyboard Shortcuts

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