Fossil: Check-in [ac199e7a8a]

Fossil SCM

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Explicitly query the client mouse coordinates, to fix the positioning of tooltips for nodes in IE.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | tooltip-experiments
Files: files | file ages | folders
SHA3-256:ac199e7a8aece7e778011ecb3a3021e462ba90ef9c7953169cf279b36ed7c1db
User & Date: florian 2019-05-28 12:16:00
Wiki:tooltip-experiments
References
2019-05-28
12:32
Cherry-pick [ac199e7a8a]: Explicitly query the client mouse coordinates, to fix the positioning of tooltips for nodes in IE. Leaf check-in: 3b5e74c4ca user: florian tags: tooltip-copyhash
Context
2019-05-28
12:32
Cherry-pick [ac199e7a8a]: Explicitly query the client mouse coordinates, to fix the positioning of tooltips for nodes in IE. Leaf check-in: 3b5e74c4ca user: florian tags: tooltip-copyhash
12:16
Explicitly query the client mouse coordinates, to fix the positioning of tooltips for nodes in IE. Leaf check-in: ac199e7a8a user: florian tags: tooltip-experiments
2019-05-27
06:58
Ensure the close timer is started for tooltips belonging to nodes instead of rails, and prevent an out-of-bounds array access for double-clicks outside of rails. check-in: d57c1a797c user: florian tags: tooltip-experiments
Changes

Changes to src/graph.js.

   155    155       }
   156    156       /* The tooltip is either not visible, or the mouse is over a different
   157    157       ** element, so clear the dwell timer, and record the new element id and
   158    158       ** mouse position. */
   159    159       stopDwellTimer();
   160    160       if(ix >= 0){
   161    161         tooltipInfo.ixHover = ix;
   162         -      tooltipInfo.posX = e.x;
   163         -      tooltipInfo.posY = e.y;
          162  +      tooltipInfo.posX = e.clientX;
          163  +      tooltipInfo.posY = e.clientY;
   164    164         stopCloseTimer();
   165    165         if(tooltipInfo.dwellTimeout>0){
   166    166           tooltipInfo.idTimer = setTimeout(function() {
   167    167             tooltipInfo.idTimer = 0;
   168    168             stopCloseTimer();
   169    169             showGraphTooltip();
   170    170           },tooltipInfo.dwellTimeout);
................................................................................
   186    186       }
   187    187     };
   188    188     function nodeHover(e){
   189    189       /* Invoked by mousemove events over a graph node */
   190    190       e.stopPropagation()
   191    191       if(tooltipInfo.ixHover==-2) return
   192    192       tooltipInfo.ixHover = -2
   193         -    tooltipInfo.posX = e.x
   194         -    tooltipInfo.posY = e.y
          193  +    tooltipInfo.posX = e.clientX
          194  +    tooltipInfo.posY = e.clientY
   195    195       tooltipInfo.nodeHover = this
   196    196       stopCloseTimer();
   197    197       if(tooltipInfo.dwellTimeout>0){
   198    198         tooltipInfo.idTimer = setTimeout(function() {
   199    199           tooltipInfo.idTimer = 0;
   200    200           stopCloseTimer();
   201    201           showGraphTooltip();
................................................................................
   555    555       window.location.href = tx.baseUrl+"/info/"+p.h
   556    556       e.stopPropagation()
   557    557     }
   558    558     function findTxIndex(e){
   559    559       /* Look at all the graph elements.  If any graph elements that is near
   560    560       ** the click-point "e" and has a "data-ix" attribute, then return
   561    561       ** the value of that attribute.  Otherwise return -1 */
   562         -    var x = e.x + window.pageXOffset - absoluteX(canvasDiv);
   563         -    var y = e.y + window.pageYOffset - absoluteY(canvasDiv);
          562  +    var x = e.clientX + window.pageXOffset - absoluteX(canvasDiv);
          563  +    var y = e.clientY + window.pageYOffset - absoluteY(canvasDiv);
   564    564       var aNode = canvasDiv.childNodes
   565    565       var nNode = aNode.length;
   566    566       var i;
   567    567       for(i=0;i<nNode;i++){
   568    568         var n = aNode[i]
   569    569         if( !n.hasAttribute("data-ix") ) continue;
   570    570         if( x<n.offsetLeft-5 ) continue;
................................................................................
   581    581       var dest = tx.baseUrl + "/timeline?r=" + encodeURIComponent(br)
   582    582       dest += tx.fileDiff ? "&m&cf=" : "&m&c="
   583    583       dest += encodeURIComponent(tx.rowinfo[ix].h)
   584    584       return dest
   585    585     }
   586    586     function clickOnGraph(e){
   587    587       tooltipInfo.ixHover = findTxIndex(e);
   588         -    tooltipInfo.posX = e.x;
   589         -    tooltipInfo.posY = e.y;
          588  +    tooltipInfo.posX = e.clientX;
          589  +    tooltipInfo.posY = e.clientY;
   590    590       showGraphTooltip();
   591    591     }
   592    592     function showGraphTooltip(){
   593    593       var html = null
   594    594       var ix = -1
   595    595       if( tooltipInfo.ixHover==-2 ){
   596    596         ix = parseInt(tooltipInfo.nodeHover.id.match(/\d+$/)[0],10)-tx.iTopRow