From f895288441953ea1f52095ff421429d377cd37a1 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 4 Aug 2022 04:52:58 +0300 Subject: UX: Enable selecting radio by clicking anywhere on the row Ease the selection of a radio button by allowing the user to click on any of the table cells that are in the same row as the radio button of concern. --- qc_app/static/js/select_platform.js | 11 +++++++++++ qc_app/templates/select_platform.html | 13 +++++++++++++ 2 files changed, 24 insertions(+) (limited to 'qc_app') diff --git a/qc_app/static/js/select_platform.js b/qc_app/static/js/select_platform.js index d7541fa..d78877e 100644 --- a/qc_app/static/js/select_platform.js +++ b/qc_app/static/js/select_platform.js @@ -57,3 +57,14 @@ function update_genechips(event) { setup_genechips(genec[species_elt.value.toLowerCase()]); } } + +function select_row_radio(row) { + radio = row.getElementsByTagName( + "td")[0].getElementsByTagName( + "input")[0]; + if(radio === undefined) { + return false; + } + radio.setAttribute("checked", "checked"); + return true; +} diff --git a/qc_app/templates/select_platform.html b/qc_app/templates/select_platform.html index 131003d..3ceae01 100644 --- a/qc_app/templates/select_platform.html +++ b/qc_app/templates/select_platform.html @@ -68,5 +68,18 @@ {%endblock%} -- cgit v1.2.3