Fossil SCM

Make all non-hyperlink elements to the left of the show/hide diff checkboxes activate those checkboxes.

stephan 2025-02-11 18:13 trunk
Commit 7f2b3a2d987aef9c396a124d0e482a3afa0c9af064e2696060ce1ad0ae766cdb
1 file changed +9
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -58,10 +58,19 @@
5858
if(btnAll){
5959
checkedCount += (this.checked ? 1 : -1);
6060
btnAll.innerText = (checkedCount < allToggles.length)
6161
? "Show diffs" : "Hide diffs";
6262
}
63
+ }, false);
64
+ /* Extend the toggle click zone to all of the non-hyperlink
65
+ elements in the left of this area (filenames and hashes). */
66
+ sib.firstElementChild.addEventListener('click', (event)=>{
67
+ if( event.target===sib.firstElementChild ){
68
+ /* Don't respond to clicks bubbling via hyperlink children */
69
+ ckbox.checked = !ckbox.checked;
70
+ ckbox.dispatchEvent(new Event('change'));
71
+ }
6372
}, false);
6473
};
6574
if( !document.querySelector('body.fdiff') ){
6675
/* Don't show the diff toggle button for /fdiff because it only
6776
has a single file to show (and also a different DOM layout). */
6877
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -58,10 +58,19 @@
58 if(btnAll){
59 checkedCount += (this.checked ? 1 : -1);
60 btnAll.innerText = (checkedCount < allToggles.length)
61 ? "Show diffs" : "Hide diffs";
62 }
 
 
 
 
 
 
 
 
 
63 }, false);
64 };
65 if( !document.querySelector('body.fdiff') ){
66 /* Don't show the diff toggle button for /fdiff because it only
67 has a single file to show (and also a different DOM layout). */
68
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -58,10 +58,19 @@
58 if(btnAll){
59 checkedCount += (this.checked ? 1 : -1);
60 btnAll.innerText = (checkedCount < allToggles.length)
61 ? "Show diffs" : "Hide diffs";
62 }
63 }, false);
64 /* Extend the toggle click zone to all of the non-hyperlink
65 elements in the left of this area (filenames and hashes). */
66 sib.firstElementChild.addEventListener('click', (event)=>{
67 if( event.target===sib.firstElementChild ){
68 /* Don't respond to clicks bubbling via hyperlink children */
69 ckbox.checked = !ckbox.checked;
70 ckbox.dispatchEvent(new Event('change'));
71 }
72 }, false);
73 };
74 if( !document.querySelector('body.fdiff') ){
75 /* Don't show the diff toggle button for /fdiff because it only
76 has a single file to show (and also a different DOM layout). */
77

Keyboard Shortcuts

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