Fossil SCM

Generalize [6b31bcfc1b] and [9a49859504] to ignore more HTML elements responding to clicks themselves. So far there's an accordion section header containing a hyperlink on the /rchvdwnld UI page and a timeline entries with nested buttons on the /download page.

florian 2025-11-15 14:07 trunk
Commit b09a9b621fd9f74944fa2a59e753b8665b11272ef8ab3f46d71c599b55c06a24
2 files changed +5 -3 +6 -4
--- src/accordion.js
+++ src/accordion.js
@@ -42,13 +42,15 @@
4242
img = document.createElement("img");
4343
img.src = acc_svgdata[0]+acc_svgdata[3]+acc_svgdata[1];
4444
img.className = "accordion_btn accordion_btn_minus";
4545
a[i].insertBefore(img,a[i].firstChild);
4646
a[i].addEventListener("click",function(evt){
47
- /* Ignore clicks to hyperlinks and form controls inside ".accordion" buttons
48
- ** (for which Fossil uses <DIV> elements that represent section headers). */
49
- if( evt.target.tagName in { 'INPUT':1, 'SELECT':1, 'A':1 } ) return;
47
+ /* Ignore clicks to hyperlinks and other "click-responsive" HTML elements in
48
+ ** ".accordion" headers (for which Fossil uses <DIV> elements that represent
49
+ ** section headers). */
50
+ var xClickyHTML = /^(?:A|AREA|BUTTON|INPUT|LABEL|SELECT|TEXTAREA|DETAILS)$/;
51
+ if( xClickyHTML.test(evt.target.tagName) ) return;
5052
var x = this.nextElementSibling;
5153
if( this.classList.contains("accordion_closed") ){
5254
x.style.maxHeight = x.scrollHeight + "px";
5355
setTimeout(function(){
5456
x.style.maxHeight = "";
5557
--- src/accordion.js
+++ src/accordion.js
@@ -42,13 +42,15 @@
42 img = document.createElement("img");
43 img.src = acc_svgdata[0]+acc_svgdata[3]+acc_svgdata[1];
44 img.className = "accordion_btn accordion_btn_minus";
45 a[i].insertBefore(img,a[i].firstChild);
46 a[i].addEventListener("click",function(evt){
47 /* Ignore clicks to hyperlinks and form controls inside ".accordion" buttons
48 ** (for which Fossil uses <DIV> elements that represent section headers). */
49 if( evt.target.tagName in { 'INPUT':1, 'SELECT':1, 'A':1 } ) return;
 
 
50 var x = this.nextElementSibling;
51 if( this.classList.contains("accordion_closed") ){
52 x.style.maxHeight = x.scrollHeight + "px";
53 setTimeout(function(){
54 x.style.maxHeight = "";
55
--- src/accordion.js
+++ src/accordion.js
@@ -42,13 +42,15 @@
42 img = document.createElement("img");
43 img.src = acc_svgdata[0]+acc_svgdata[3]+acc_svgdata[1];
44 img.className = "accordion_btn accordion_btn_minus";
45 a[i].insertBefore(img,a[i].firstChild);
46 a[i].addEventListener("click",function(evt){
47 /* Ignore clicks to hyperlinks and other "click-responsive" HTML elements in
48 ** ".accordion" headers (for which Fossil uses <DIV> elements that represent
49 ** section headers). */
50 var xClickyHTML = /^(?:A|AREA|BUTTON|INPUT|LABEL|SELECT|TEXTAREA|DETAILS)$/;
51 if( xClickyHTML.test(evt.target.tagName) ) return;
52 var x = this.nextElementSibling;
53 if( this.classList.contains("accordion_closed") ){
54 x.style.maxHeight = x.scrollHeight + "px";
55 setTimeout(function(){
56 x.style.maxHeight = "";
57
+6 -4
--- src/graph.js
+++ src/graph.js
@@ -722,14 +722,16 @@
722722
function changeDisplayById(id,value){
723723
var x = document.getElementById(id);
724724
if(x) x.style.display=value;
725725
}
726726
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
+ /* Ignore clicks to hyperlinks and other "click-responsive" HTML elements.
728
+ ** This click-handler is set for <SPAN> elements with the CSS class names
729
+ ** "timelineEllipsis" and "timelineCompactComment", which are part of the
730
+ ** "Compact" and "Simple" views. */
731
+ var xClickyHTML = /^(?:A|AREA|BUTTON|INPUT|LABEL|SELECT|TEXTAREA|DETAILS)$/;
732
+ if( xClickyHTML.test(evt.target.tagName) ) return;
731733
var id = parseInt(this.getAttribute('data-id'))
732734
var x = document.getElementById("detail-"+id);
733735
if( x.style.display=="inline" ){
734736
x.style.display="none";
735737
document.getElementById("ellipsis-"+id).textContent = "...";
736738
--- src/graph.js
+++ src/graph.js
@@ -722,14 +722,16 @@
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 = "...";
736
--- src/graph.js
+++ src/graph.js
@@ -722,14 +722,16 @@
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 and other "click-responsive" HTML elements.
728 ** This click-handler is set for <SPAN> elements with the CSS class names
729 ** "timelineEllipsis" and "timelineCompactComment", which are part of the
730 ** "Compact" and "Simple" views. */
731 var xClickyHTML = /^(?:A|AREA|BUTTON|INPUT|LABEL|SELECT|TEXTAREA|DETAILS)$/;
732 if( xClickyHTML.test(evt.target.tagName) ) return;
733 var id = parseInt(this.getAttribute('data-id'))
734 var x = document.getElementById("detail-"+id);
735 if( x.style.display=="inline" ){
736 x.style.display="none";
737 document.getElementById("ellipsis-"+id).textContent = "...";
738

Keyboard Shortcuts

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