Fossil SCM
Fix the accordion section header on the /rchvdwnld web UI page, and have the accordion click-handler ignore clicks to hyperlinks inside section headers (so that the accordion section does not expand or contract immediately before navigating to the linked page).
Commit
6b31bcfc1b4f55450c5611a9ccdda8f0d286c7c75ff169aebfcc9f51b007feb4
Parent
ff7fe39421d9648…
2 files changed
+4
-1
+1
+4
-1
| --- src/accordion.js | ||
| +++ src/accordion.js | ||
| @@ -41,11 +41,14 @@ | ||
| 41 | 41 | a[i].insertBefore(img,a[i].firstChild); |
| 42 | 42 | img = document.createElement("img"); |
| 43 | 43 | img.src = acc_svgdata[0]+acc_svgdata[3]+acc_svgdata[1]; |
| 44 | 44 | img.className = "accordion_btn accordion_btn_minus"; |
| 45 | 45 | a[i].insertBefore(img,a[i].firstChild); |
| 46 | - a[i].addEventListener("click",function(){ | |
| 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; | |
| 47 | 50 | var x = this.nextElementSibling; |
| 48 | 51 | if( this.classList.contains("accordion_closed") ){ |
| 49 | 52 | x.style.maxHeight = x.scrollHeight + "px"; |
| 50 | 53 | setTimeout(function(){ |
| 51 | 54 | x.style.maxHeight = ""; |
| 52 | 55 |
| --- src/accordion.js | |
| +++ src/accordion.js | |
| @@ -41,11 +41,14 @@ | |
| 41 | a[i].insertBefore(img,a[i].firstChild); |
| 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(){ |
| 47 | var x = this.nextElementSibling; |
| 48 | if( this.classList.contains("accordion_closed") ){ |
| 49 | x.style.maxHeight = x.scrollHeight + "px"; |
| 50 | setTimeout(function(){ |
| 51 | x.style.maxHeight = ""; |
| 52 |
| --- src/accordion.js | |
| +++ src/accordion.js | |
| @@ -41,11 +41,14 @@ | |
| 41 | a[i].insertBefore(img,a[i].firstChild); |
| 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 |
+1
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -1356,7 +1356,8 @@ | ||
| 1356 | 1356 | @ </table></div> |
| 1357 | 1357 | fossil_free(zBase); |
| 1358 | 1358 | @ <div class="section accordion">Context</div><div class="accordion_panel"> |
| 1359 | 1359 | render_checkin_context(rid, 0, 0, 0); |
| 1360 | 1360 | @ </div> |
| 1361 | + builtin_request_js("accordion.js"); | |
| 1361 | 1362 | style_finish_page(); |
| 1362 | 1363 | } |
| 1363 | 1364 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -1356,7 +1356,8 @@ | |
| 1356 | @ </table></div> |
| 1357 | fossil_free(zBase); |
| 1358 | @ <div class="section accordion">Context</div><div class="accordion_panel"> |
| 1359 | render_checkin_context(rid, 0, 0, 0); |
| 1360 | @ </div> |
| 1361 | style_finish_page(); |
| 1362 | } |
| 1363 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -1356,7 +1356,8 @@ | |
| 1356 | @ </table></div> |
| 1357 | fossil_free(zBase); |
| 1358 | @ <div class="section accordion">Context</div><div class="accordion_panel"> |
| 1359 | render_checkin_context(rid, 0, 0, 0); |
| 1360 | @ </div> |
| 1361 | builtin_request_js("accordion.js"); |
| 1362 | style_finish_page(); |
| 1363 | } |
| 1364 |