From aa2d7a45fca8c6503a5de6cec7ce58d248144b9d Mon Sep 17 00:00:00 2001
From: uditgulati
Date: Sun, 6 Sep 2020 10:38:19 -0500
Subject: add row highlight on checkbox checked state
---
wqflask/wqflask/static/new/css/snp_browser.css | 4 ++++
wqflask/wqflask/templates/snp_browser.html | 17 +++++++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)
(limited to 'wqflask')
diff --git a/wqflask/wqflask/static/new/css/snp_browser.css b/wqflask/wqflask/static/new/css/snp_browser.css
index 1dd332cb..a7942d2a 100644
--- a/wqflask/wqflask/static/new/css/snp_browser.css
+++ b/wqflask/wqflask/static/new/css/snp_browser.css
@@ -6,6 +6,10 @@ table.dataTable thead th {
vertical-align: bottom;
}
+table.dataTable tbody tr.selected {
+ background-color: #ffee99;
+}
+
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc,
diff --git a/wqflask/wqflask/templates/snp_browser.html b/wqflask/wqflask/templates/snp_browser.html
index 435a521c..c312aee8 100644
--- a/wqflask/wqflask/templates/snp_browser.html
+++ b/wqflask/wqflask/templates/snp_browser.html
@@ -283,7 +283,7 @@
'className': 'dt-body-center',
'orderable': false,
'render': function(data, type, row, meta) {
- return ''
+ return ''
}
}, {
'data': 'index',
@@ -396,7 +396,7 @@
{
'data': null,
'render': function(data, type, row, meta) {
- return ''
+ return ''
}
}, {
'data': 'index',
@@ -437,6 +437,19 @@
});
{% endif %}
+ function onVarinatCheck(checkboxElem) {
+ if (checkboxElem.checked) {
+ if (!checkboxElem.parentElement.parentElement.classList.contains('selected')) {
+ checkboxElem.parentElement.parentElement.classList.add('selected')
+ }
+ }
+ else {
+ if (checkboxElem.parentElement.parentElement.classList.contains('selected')) {
+ checkboxElem.parentElement.parentElement.classList.remove('selected')
+ }
+ }
+ }
+
$("#species_select").change(function() {
this_species = $(this).val();
$("#strain_select").empty()
--
cgit v1.2.3