From 2f141e92177e3857f81b17fa8335e16dd4fdbeed Mon Sep 17 00:00:00 2001 From: zmagod Date: Fri, 15 Jun 2018 11:37:01 +0200 Subject: [PATCH] disable buttons on new/edit repository_item action [fixes SCI-2410] --- .../repositories/repository_datatable.js.erb | 6 ++++++ app/views/repositories/show.html.erb | 19 +++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/repositories/repository_datatable.js.erb b/app/assets/javascripts/repositories/repository_datatable.js.erb index d14328a06..f8e3b3f49 100644 --- a/app/assets/javascripts/repositories/repository_datatable.js.erb +++ b/app/assets/javascripts/repositories/repository_datatable.js.erb @@ -835,6 +835,9 @@ var RepositoryDatatable = (function(global) { if (currentMode === 'viewMode') { $('#addRepositoryRecord').removeClass('disabled'); $('#addRepositoryRecord').prop('disabled', false); + $('.dataTables_length select').prop('disabled', false); + $('#repository-acitons-dropdown').removeClass('disabled'); + $('#repository-acitons-dropdown').prop('disabled', false); $('#addNewColumn').removeClass('disabled'); $('#addNewColumn').prop('disabled', false); $('#repository-columns-dropdown') @@ -891,6 +894,9 @@ var RepositoryDatatable = (function(global) { $('#unassignRepositoryRecords').prop('disabled', false); } } else if (currentMode === 'editMode') { + $('#repository-acitons-dropdown').addClass('disabled'); + $('#repository-acitons-dropdown').prop('disabled', true); + $('.dataTables_length select').prop('disabled', true); $('#addRepositoryRecord').addClass('disabled'); $('#addRepositoryRecord').prop('disabled', true); $('#editRepositoryRecord').addClass('disabled'); diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 205ef27f6..7cb4c5325 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -15,18 +15,18 @@ <% end %> -
-