diff --git a/anatomy/static/js/anatomy.js b/anatomy/static/js/anatomy.js index e30558cd..3f650494 100644 --- a/anatomy/static/js/anatomy.js +++ b/anatomy/static/js/anatomy.js @@ -176,37 +176,6 @@ $(document).ready(function () { }); - // Table row selection - // Delegate click event to all table rows - document.querySelectorAll('.row-selector tbody tr').forEach(function(row) { - row.addEventListener('click', function(e) { - // Ignore clicks on links or checkboxes - if (e.target.tagName === 'A' || e.target.tagName === 'INPUT') return; - - // Find the checkbox in this row - const checkbox = row.querySelector('input[name="selection"]'); - if (checkbox) { - checkbox.checked = !checkbox.checked; - row.classList.toggle('selected', checkbox.checked); - } - }); - - // Keep row visually in sync with checkbox state (e.g. after page reload) - const checkbox = row.querySelector('input[name="selection"]'); - if (checkbox && checkbox.checked) { - row.classList.add('selected'); - } - // Also toggle row selection when checkbox is clicked directly - if (checkbox) { - checkbox.addEventListener('click', function(e) { - row.classList.toggle('selected', checkbox.checked); - // Prevent row click event from firing - e.stopPropagation(); - }); - } - }); - - }); window.loadDicomViewerEvent = new Event('loadDicomViewer'); diff --git a/atlas/tables.py b/atlas/tables.py index 388bba86..f516b9ff 100755 --- a/atlas/tables.py +++ b/atlas/tables.py @@ -1,7 +1,7 @@ import django_tables2 as tables from django_tables2.utils import A -from generic.tables import SeriesImageColumn +from generic.tables import SeriesImageColumn, SelectionTable from .models import ( Case, @@ -25,7 +25,7 @@ from easy_thumbnails.exceptions import InvalidImageFormatError from django.db.models import Prefetch -class CaseTable(tables.Table): +class CaseTable(SelectionTable): def __init__(self, data=None, *args, **kwargs): # Optimize prefetching for casecollection_set #case_collections_prefetch = Prefetch( @@ -190,7 +190,7 @@ class CaseTable(tables.Table): ) sequence = ("view", ) order_by = "-created_date" - attrs = {"class": "table row-selector"} + attrs = {"class": "table"} diff --git a/rad/static/css/anatomy.css b/rad/static/css/anatomy.css index b3026a1e..07d9d29c 100644 --- a/rad/static/css/anatomy.css +++ b/rad/static/css/anatomy.css @@ -1397,19 +1397,6 @@ span#user-id { opacity: 1; } - - -/* Highlight row on hover */ -.row-selector tbody tr:hover td { - background-color: darkblue; - cursor: pointer; -} -/* Highlight selected row */ -.row-selector tbody tr.selected td { - background-color: #b3d7ff !important; - color: #333; -} - .image-block { min-width: 100px; display: inline-block;