Artifact 7db676b32eb1324bcd8a9be6591ca6174081ecfe83e5506db678a068c9b2a888:
- File src/fossil.info-diff.js — part of check-in [f9d29b9702] at 2021-03-02 03:51:47 on branch diff-view-toggle-poc — Moved the diff toggle button to the right of the diff header line, per forum feedback. Changed the button to a checkbox. Removed the arbitrary heuristics regarding which diffs to show/hide by default - they are now all on by default. (user: stephan size: 486) [more...]
"use strict"; window.fossil.onPageLoad(function(){ const F = window.fossil, D = F.dom; const addToggle = function(diffElem){ const sib = diffElem.previousElementSibling, btn = sib ? D.addClass(D.checkbox(true), 'diff-toggle') : 0; if(!sib) return; D.append(sib,btn); btn.addEventListener('click', function(){ diffElem.classList.toggle('hidden'); }, false); }; document.querySelectorAll('pre.udiff, table.sbsdiffcols').forEach(addToggle); });