Fossil SCM
Fix the "Compact" and "Simple" timeline view modes so that clicks to hyperlinks in check-in comments do not turn the details on and off immediately before navigating to the linked page.
Commit
9a4985950477fa7c4bf9417b54d0d185f01d2d996b204cfd7f3186e1aae11fc2
Parent
6b31bcfc1b4f554…
1 file changed
+11
-3
+11
-3
| --- src/graph.js | ||
| +++ src/graph.js | ||
| @@ -721,11 +721,15 @@ | ||
| 721 | 721 | } |
| 722 | 722 | function changeDisplayById(id,value){ |
| 723 | 723 | var x = document.getElementById(id); |
| 724 | 724 | if(x) x.style.display=value; |
| 725 | 725 | } |
| 726 | - function toggleDetail(){ | |
| 726 | + function toggleDetail(evt){ | |
| 727 | + /* Ignore clicks to hyperlinks in check-in comments. This click-handler is | |
| 728 | + ** attached to <SPAN> elements with the CSS class names "timelineEllipsis" | |
| 729 | + ** and "timelineCompactComment" (for the "Compact" and "Simple" views). */ | |
| 730 | + if( evt.target.tagName=='A' ) return; | |
| 727 | 731 | var id = parseInt(this.getAttribute('data-id')) |
| 728 | 732 | var x = document.getElementById("detail-"+id); |
| 729 | 733 | if( x.style.display=="inline" ){ |
| 730 | 734 | x.style.display="none"; |
| 731 | 735 | document.getElementById("ellipsis-"+id).textContent = "..."; |
| @@ -770,15 +774,19 @@ | ||
| 770 | 774 | ** "Simple" views so that clicking turns the details on and off. |
| 771 | 775 | */ |
| 772 | 776 | var lx = topObj.getElementsByClassName('timelineEllipsis'); |
| 773 | 777 | var i; |
| 774 | 778 | for(i=0; i<lx.length; i++){ |
| 775 | - if( lx[i].hasAttribute('data-id') ) lx[i].onclick = toggleDetail; | |
| 779 | + if( lx[i].hasAttribute('data-id') ){ | |
| 780 | + lx[i].addEventListener('click',toggleDetail); | |
| 781 | + } | |
| 776 | 782 | } |
| 777 | 783 | lx = topObj.getElementsByClassName('timelineCompactComment'); |
| 778 | 784 | for(i=0; i<lx.length; i++){ |
| 779 | - if( lx[i].hasAttribute('data-id') ) lx[i].onclick = toggleDetail; | |
| 785 | + if( lx[i].hasAttribute('data-id') ){ | |
| 786 | + lx[i].addEventListener('click',toggleDetail); | |
| 787 | + } | |
| 780 | 788 | } |
| 781 | 789 | if( window.innerWidth<400 ){ |
| 782 | 790 | /* On narrow displays, shift the date from the first column to the |
| 783 | 791 | ** third column, to make the first column narrower */ |
| 784 | 792 | lx = topObj.getElementsByClassName('timelineDateRow'); |
| 785 | 793 |
| --- src/graph.js | |
| +++ src/graph.js | |
| @@ -721,11 +721,15 @@ | |
| 721 | } |
| 722 | function changeDisplayById(id,value){ |
| 723 | var x = document.getElementById(id); |
| 724 | if(x) x.style.display=value; |
| 725 | } |
| 726 | function toggleDetail(){ |
| 727 | var id = parseInt(this.getAttribute('data-id')) |
| 728 | var x = document.getElementById("detail-"+id); |
| 729 | if( x.style.display=="inline" ){ |
| 730 | x.style.display="none"; |
| 731 | document.getElementById("ellipsis-"+id).textContent = "..."; |
| @@ -770,15 +774,19 @@ | |
| 770 | ** "Simple" views so that clicking turns the details on and off. |
| 771 | */ |
| 772 | var lx = topObj.getElementsByClassName('timelineEllipsis'); |
| 773 | var i; |
| 774 | for(i=0; i<lx.length; i++){ |
| 775 | if( lx[i].hasAttribute('data-id') ) lx[i].onclick = toggleDetail; |
| 776 | } |
| 777 | lx = topObj.getElementsByClassName('timelineCompactComment'); |
| 778 | for(i=0; i<lx.length; i++){ |
| 779 | if( lx[i].hasAttribute('data-id') ) lx[i].onclick = toggleDetail; |
| 780 | } |
| 781 | if( window.innerWidth<400 ){ |
| 782 | /* On narrow displays, shift the date from the first column to the |
| 783 | ** third column, to make the first column narrower */ |
| 784 | lx = topObj.getElementsByClassName('timelineDateRow'); |
| 785 |
| --- src/graph.js | |
| +++ src/graph.js | |
| @@ -721,11 +721,15 @@ | |
| 721 | } |
| 722 | function changeDisplayById(id,value){ |
| 723 | var x = document.getElementById(id); |
| 724 | if(x) x.style.display=value; |
| 725 | } |
| 726 | function toggleDetail(evt){ |
| 727 | /* Ignore clicks to hyperlinks in check-in comments. This click-handler is |
| 728 | ** attached to <SPAN> elements with the CSS class names "timelineEllipsis" |
| 729 | ** and "timelineCompactComment" (for the "Compact" and "Simple" views). */ |
| 730 | if( evt.target.tagName=='A' ) return; |
| 731 | var id = parseInt(this.getAttribute('data-id')) |
| 732 | var x = document.getElementById("detail-"+id); |
| 733 | if( x.style.display=="inline" ){ |
| 734 | x.style.display="none"; |
| 735 | document.getElementById("ellipsis-"+id).textContent = "..."; |
| @@ -770,15 +774,19 @@ | |
| 774 | ** "Simple" views so that clicking turns the details on and off. |
| 775 | */ |
| 776 | var lx = topObj.getElementsByClassName('timelineEllipsis'); |
| 777 | var i; |
| 778 | for(i=0; i<lx.length; i++){ |
| 779 | if( lx[i].hasAttribute('data-id') ){ |
| 780 | lx[i].addEventListener('click',toggleDetail); |
| 781 | } |
| 782 | } |
| 783 | lx = topObj.getElementsByClassName('timelineCompactComment'); |
| 784 | for(i=0; i<lx.length; i++){ |
| 785 | if( lx[i].hasAttribute('data-id') ){ |
| 786 | lx[i].addEventListener('click',toggleDetail); |
| 787 | } |
| 788 | } |
| 789 | if( window.innerWidth<400 ){ |
| 790 | /* On narrow displays, shift the date from the first column to the |
| 791 | ** third column, to make the first column narrower */ |
| 792 | lx = topObj.getElementsByClassName('timelineDateRow'); |
| 793 |