Fix selection toggle logic for series items in user uploads
This commit is contained in:
@@ -394,17 +394,17 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Row click toggles selection when clicking any non-interactive part of the series card
|
// Row click toggles selection when clicking any non-interactive part of the series card
|
||||||
document.body.addEventListener('click', function (e) {
|
document.body.addEventListener('click', function (e) {
|
||||||
const item = e.target.closest('.series-item');
|
const item = e.target.closest('.series-item');
|
||||||
if (!item) return;
|
if (!item) return;
|
||||||
// ignore clicks on links, buttons, inputs or forms inside the item
|
// ignore clicks on links, buttons, inputs or forms inside the item
|
||||||
if (e.target.closest('a,button,input,form')) return;
|
if (e.target.closest('a,button,input,form')) return;
|
||||||
const cb = item.querySelector('input[name="selection"]');
|
const cb = item.querySelector('input[name="selection"]');
|
||||||
if (!cb || cb.disabled) return;
|
if (!cb || cb.disabled) return;
|
||||||
cb.checked = !cb.checked;
|
cb.checked = !cb.checked;
|
||||||
item.classList.toggle('selected', cb.checked);
|
item.classList.toggle('selected', cb.checked);
|
||||||
cb.dispatchEvent(new Event('change', { bubbles: true }));
|
cb.dispatchEvent(new Event('change', { bubbles: true }));
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
Reference in New Issue
Block a user