From 914de7421f6f60f84f32360fcc26aa16f9033a87 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Thu, 25 Aug 2022 09:28:55 +0100 Subject: [PATCH] adapted checkbox text --- cara/apps/calculator/static/js/report.js | 13 ++++++------- cara/apps/templates/base/calculator.report.html.j2 | 6 +++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/cara/apps/calculator/static/js/report.js b/cara/apps/calculator/static/js/report.js index 91f948da..8e09b9e3 100644 --- a/cara/apps/calculator/static/js/report.js +++ b/cara/apps/calculator/static/js/report.js @@ -862,15 +862,14 @@ function copy_clipboard(shareable_link) { navigator.clipboard.writeText(shareable_link); } -function display_rename_column(bool, id) { +function check_download_button() { // Handle the disable property of the download button let download_button = document.getElementById('downloadCSV'); - if (document.querySelectorAll('input[type="checkbox"]:checked').length <= 1) { - download_button.disabled = true; - } - else { - download_button.disabled = false; - } + document.querySelectorAll('input[type="checkbox"]:checked').length <= 1 ? download_button.disabled = true : download_button.disabled = false; +} + +function display_rename_column(bool, id) { + check_download_button(); // Change the visibility of renaming section if (bool) document.getElementById(id).style.display = 'flex'; else document.getElementById(id).style.display = 'none'; diff --git a/cara/apps/templates/base/calculator.report.html.j2 b/cara/apps/templates/base/calculator.report.html.j2 index 45c2f3bb..564af30f 100644 --- a/cara/apps/templates/base/calculator.report.html.j2 +++ b/cara/apps/templates/base/calculator.report.html.j2 @@ -248,7 +248,7 @@
- + {% else %}
- - + +
{% endif %}