about summary refs log tree commit diff
path: root/uploader/static
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/static')
-rw-r--r--uploader/static/js/datatables.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/uploader/static/js/datatables.js b/uploader/static/js/datatables.js
new file mode 100644
index 0000000..586ef30
--- /dev/null
+++ b/uploader/static/js/datatables.js
@@ -0,0 +1,18 @@
+/** Handlers for events in datatables **/
+
+$(() => {
+    $("#tbl-phenotypes-list").on("draw.dt", () => {
+        $(".chk-row-select").on("change", (event) => {
+            var checkbox = event.target;
+            var tablerow = checkbox.parentElement.parentElement;
+            var tableclass = tablerow.getAttribute("class");
+            if(checkbox.checked) {
+                tablerow.setAttribute("class", `${tableclass} selected`);
+            }
+            else {
+                tablerow.setAttribute(
+                    "class", tableclass.replace("selected", "").trim());
+            }
+        });
+    });
+});