Compare commits
No commits in common. "fe9d7293d0681d1e3153dd1d9c872463bb1fdd29" and "9777cb2ea78d878eb5748434422fce6f6b9ae782" have entirely different histories.
fe9d7293d0
...
9777cb2ea7
@ -1 +1 @@
|
||||
v20260101-09-run-checks-shift-multiselect-range-highlight-fix
|
||||
v20260101-08-run-checks-shift-multiselect-persist
|
||||
|
||||
@ -351,19 +351,8 @@ function statusClass(status) {
|
||||
return ids.filter(function (x) { return Number.isFinite(x); });
|
||||
}
|
||||
|
||||
function refreshRowHighlights() {
|
||||
var cbs = table.querySelectorAll('tbody .rc_row_cb');
|
||||
cbs.forEach(function (cb) {
|
||||
var tr = cb.closest ? cb.closest('tr') : null;
|
||||
if (!tr) return;
|
||||
if (cb.checked) tr.classList.add('table-active');
|
||||
else tr.classList.remove('table-active');
|
||||
});
|
||||
}
|
||||
|
||||
function updateButtons() {
|
||||
var ids = getSelectedJobIds();
|
||||
refreshRowHighlights();
|
||||
if (btnMark) btnMark.disabled = ids.length === 0;
|
||||
if (btnUnmark) btnUnmark.disabled = ids.length === 0;
|
||||
if (statusEl) statusEl.textContent = ids.length ? (ids.length + ' selected') : '';
|
||||
@ -393,11 +382,10 @@ table.addEventListener('mousedown', function (e) {
|
||||
var t = e.target;
|
||||
if (!t) return;
|
||||
|
||||
var cb = (t.classList && t.classList.contains('rc_row_cb')) ? t : (t.closest ? t.closest('.rc_row_cb') : null);
|
||||
if (cb) {
|
||||
if (t.classList && t.classList.contains('rc_row_cb')) {
|
||||
// Remember state before click so Shift-click logic can reliably compute the intended target state
|
||||
lastMouseDownCb = cb;
|
||||
lastMouseDownChecked = cb.checked;
|
||||
lastMouseDownCb = t;
|
||||
lastMouseDownChecked = t.checked;
|
||||
|
||||
if (e.shiftKey) {
|
||||
e.preventDefault();
|
||||
@ -411,10 +399,7 @@ table.addEventListener('mousedown', function (e) {
|
||||
// Handle Shift-click range selection on the checkbox inputs (delegated)
|
||||
table.addEventListener('click', function (e) {
|
||||
var t = e.target;
|
||||
if (!t) return;
|
||||
var cb = (t.classList && t.classList.contains('rc_row_cb')) ? t : (t.closest ? t.closest('.rc_row_cb') : null);
|
||||
if (!cb) return;
|
||||
t = cb;
|
||||
if (!t || !(t.classList && t.classList.contains('rc_row_cb'))) return;
|
||||
|
||||
// Custom handling so we can reliably read shiftKey and control the toggle + range
|
||||
if (e.shiftKey && lastCheckedCb && lastCheckedCb !== t) {
|
||||
@ -431,19 +416,15 @@ table.addEventListener('click', function (e) {
|
||||
lastMouseDownCb = null;
|
||||
lastMouseDownChecked = null;
|
||||
|
||||
var rows = Array.prototype.slice.call(table.querySelectorAll('tbody tr'));
|
||||
var startRow = lastCheckedCb.closest ? lastCheckedCb.closest('tr') : null;
|
||||
var endRow = t.closest ? t.closest('tr') : null;
|
||||
|
||||
var start = startRow ? rows.indexOf(startRow) : -1;
|
||||
var end = endRow ? rows.indexOf(endRow) : -1;
|
||||
var cbs = Array.prototype.slice.call(table.querySelectorAll('tbody .rc_row_cb'));
|
||||
var start = cbs.indexOf(lastCheckedCb);
|
||||
var end = cbs.indexOf(t);
|
||||
|
||||
if (start !== -1 && end !== -1) {
|
||||
var lo = Math.min(start, end);
|
||||
var hi = Math.max(start, end);
|
||||
for (var i = lo; i <= hi; i++) {
|
||||
var cb = rows[i].querySelector('.rc_row_cb');
|
||||
if (cb) cb.checked = targetChecked;
|
||||
cbs[i].checked = targetChecked;
|
||||
}
|
||||
}
|
||||
|
||||
@ -470,12 +451,10 @@ table.addEventListener('click', function (e) {
|
||||
|
||||
// Fallback for keyboard toggles (space) and other state changes
|
||||
table.addEventListener('change', function (e) {
|
||||
var t = e.target;
|
||||
if (!t) return;
|
||||
var cb = (t.classList && t.classList.contains('rc_row_cb')) ? t : (t.closest ? t.closest('.rc_row_cb') : null);
|
||||
if (!cb) return;
|
||||
lastCheckedCb = cb;
|
||||
if (e.target && e.target.classList && e.target.classList.contains('rc_row_cb')) {
|
||||
lastCheckedCb = e.target;
|
||||
updateButtons();
|
||||
}
|
||||
});
|
||||
|
||||
function postJson(url, body) {
|
||||
|
||||
@ -158,15 +158,6 @@
|
||||
- Fixed Shift-click multi-select on the Run Checks page so the initial checkbox selection is preserved when selecting additional rows with Shift.
|
||||
- Made Shift range selection use the checkbox pre-click state to prevent unintended double-toggles across browsers.
|
||||
|
||||
---
|
||||
|
||||
## v20260101-09-run-checks-shift-multiselect-range-highlight-fix
|
||||
|
||||
### Changed
|
||||
- Fixed shift-click multi-select behavior on the Run Checks page to include the clicked row in the selection range.
|
||||
- Corrected an off-by-one issue where selection previously stopped one row above the clicked item.
|
||||
- Added visual highlighting for all rows that are selected via checkmarks to clearly indicate active selection.
|
||||
|
||||
================================================================================================================================================
|
||||
## v0.1.14
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user