Fossil SCM

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.

florian 2019-05-27 06:58 tooltip-experiments
Commit d57c1a797ce9cff50e040ec0d21e2fd793e1beb9d8ada09bd724d6e995ddc08a
1 file changed +5 -2
+5 -2
--- src/graph.js
+++ src/graph.js
@@ -599,10 +599,11 @@
599599
if( tx.fileDiff ){
600600
html = "artifact <a href=\""+dest+"\">"+h+"</a>"
601601
}else{
602602
html = "check-in <a href=\""+dest+"\">"+h+"</a>"
603603
}
604
+ tooltipInfo.ixActive = -2;
604605
}else if( tooltipInfo.ixHover>=0 ){
605606
ix = tooltipInfo.ixHover
606607
var br = tx.rowinfo[ix].br
607608
var dest = branchHyperlink(ix)
608609
var hbr = br.replace(/&/g, "&amp;")
@@ -639,13 +640,15 @@
639640
hideGraphTooltip()
640641
}
641642
}
642643
function dblclickOnGraph(e){
643644
var ix = findTxIndex(e);
644
- var dest = branchHyperlink(ix)
645645
hideGraphTooltip()
646
- window.location.href = dest
646
+ if( ix>=0 ){
647
+ var dest = branchHyperlink(ix)
648
+ window.location.href = dest
649
+ }
647650
}
648651
function changeDisplay(selector,value){
649652
var x = document.getElementsByClassName(selector);
650653
var n = x.length;
651654
for(var i=0; i<n; i++) {x[i].style.display = value;}
652655
--- src/graph.js
+++ src/graph.js
@@ -599,10 +599,11 @@
599 if( tx.fileDiff ){
600 html = "artifact <a href=\""+dest+"\">"+h+"</a>"
601 }else{
602 html = "check-in <a href=\""+dest+"\">"+h+"</a>"
603 }
 
604 }else if( tooltipInfo.ixHover>=0 ){
605 ix = tooltipInfo.ixHover
606 var br = tx.rowinfo[ix].br
607 var dest = branchHyperlink(ix)
608 var hbr = br.replace(/&/g, "&amp;")
@@ -639,13 +640,15 @@
639 hideGraphTooltip()
640 }
641 }
642 function dblclickOnGraph(e){
643 var ix = findTxIndex(e);
644 var dest = branchHyperlink(ix)
645 hideGraphTooltip()
646 window.location.href = dest
 
 
 
647 }
648 function changeDisplay(selector,value){
649 var x = document.getElementsByClassName(selector);
650 var n = x.length;
651 for(var i=0; i<n; i++) {x[i].style.display = value;}
652
--- src/graph.js
+++ src/graph.js
@@ -599,10 +599,11 @@
599 if( tx.fileDiff ){
600 html = "artifact <a href=\""+dest+"\">"+h+"</a>"
601 }else{
602 html = "check-in <a href=\""+dest+"\">"+h+"</a>"
603 }
604 tooltipInfo.ixActive = -2;
605 }else if( tooltipInfo.ixHover>=0 ){
606 ix = tooltipInfo.ixHover
607 var br = tx.rowinfo[ix].br
608 var dest = branchHyperlink(ix)
609 var hbr = br.replace(/&/g, "&amp;")
@@ -639,13 +640,15 @@
640 hideGraphTooltip()
641 }
642 }
643 function dblclickOnGraph(e){
644 var ix = findTxIndex(e);
 
645 hideGraphTooltip()
646 if( ix>=0 ){
647 var dest = branchHyperlink(ix)
648 window.location.href = dest
649 }
650 }
651 function changeDisplay(selector,value){
652 var x = document.getElementsByClassName(selector);
653 var n = x.length;
654 for(var i=0; i<n; i++) {x[i].style.display = value;}
655

Keyboard Shortcuts

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