From 1f0d9f3ad7126a49e7b178c6e58b59d62bfd10ce Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Thu, 3 Sep 2020 16:19:02 +0200 Subject: [PATCH] Fix buttons visability on reports page according to new styleguide --- .../javascripts/reports/reports_datatable.js.erb | 12 ++++++------ app/views/reports/index.html.erb | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/reports/reports_datatable.js.erb b/app/assets/javascripts/reports/reports_datatable.js.erb index 92901cdb6..c446e1c0c 100644 --- a/app/assets/javascripts/reports/reports_datatable.js.erb +++ b/app/assets/javascripts/reports/reports_datatable.js.erb @@ -114,14 +114,14 @@ var editReportButton = $('#edit-report-btn'); var deleteReportsButton = $('#delete-reports-btn'); if (CHECKED_REPORTS.length === 0) { - editReportButton.addClass("disabled"); - deleteReportsButton.addClass("disabled"); + editReportButton.addClass("disabled hidden"); + deleteReportsButton.addClass("disabled hidden"); } else if (CHECKED_REPORTS.length === 1) { - editReportButton.removeClass("disabled"); - deleteReportsButton.removeClass("disabled"); + editReportButton.removeClass("disabled hidden"); + deleteReportsButton.removeClass("disabled hidden"); } else { - editReportButton.addClass("disabled"); - deleteReportsButton.removeClass("disabled"); + editReportButton.removeClass('hidden').addClass('disabled'); + deleteReportsButton.removeClass("disabled hidden"); } } diff --git a/app/views/reports/index.html.erb b/app/views/reports/index.html.erb index 08acfca06..320308e44 100644 --- a/app/views/reports/index.html.erb +++ b/app/views/reports/index.html.erb @@ -14,11 +14,11 @@ <% end %> - <%= link_to "", remote: true, class: "btn btn-secondary", id: "edit-report-btn" do %> + <%= link_to "", remote: true, class: "btn btn-light disabled hidden", id: "edit-report-btn" do %> <% end %> - <%= link_to "", remote: true, class: "btn btn-secondary", id: "delete-reports-btn" do %> + <%= link_to "", remote: true, class: "btn btn-light disabled hidden", id: "delete-reports-btn" do %> <% end %>