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.

florian 2025-11-04 16:09 trunk
Commit 9a4985950477fa7c4bf9417b54d0d185f01d2d996b204cfd7f3186e1aae11fc2
1 file changed +11 -3
+11 -3
--- src/graph.js
+++ src/graph.js
@@ -721,11 +721,15 @@
721721
}
722722
function changeDisplayById(id,value){
723723
var x = document.getElementById(id);
724724
if(x) x.style.display=value;
725725
}
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;
727731
var id = parseInt(this.getAttribute('data-id'))
728732
var x = document.getElementById("detail-"+id);
729733
if( x.style.display=="inline" ){
730734
x.style.display="none";
731735
document.getElementById("ellipsis-"+id).textContent = "...";
@@ -770,15 +774,19 @@
770774
** "Simple" views so that clicking turns the details on and off.
771775
*/
772776
var lx = topObj.getElementsByClassName('timelineEllipsis');
773777
var i;
774778
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
+ }
776782
}
777783
lx = topObj.getElementsByClassName('timelineCompactComment');
778784
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
+ }
780788
}
781789
if( window.innerWidth<400 ){
782790
/* On narrow displays, shift the date from the first column to the
783791
** third column, to make the first column narrower */
784792
lx = topObj.getElementsByClassName('timelineDateRow');
785793
--- 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

Keyboard Shortcuts

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