disable buttons on new/edit repository_item action [fixes SCI-2410]

This commit is contained in:
zmagod 2018-06-15 11:37:01 +02:00
parent 801d0a4a22
commit 2f141e9217
2 changed files with 15 additions and 10 deletions

View file

@ -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');

View file

@ -15,18 +15,18 @@
</button>
<% end %>
<div class="repository-cog">
<div class="dropdown">
<div class="btn btn-default"
type="button"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="true"
<%= "disabled" unless can_perform_repository_actions(@repository) %>>
<div class="repository-cog dropdown">
<button id="repository-acitons-dropdown"
class="btn btn-default"
type="button"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="true"
<%= "disabled" unless can_perform_repository_actions(@repository) %>>
<span class="fas fa-ellipsis-v"></span>
<span class="hidden-xs"><%= t('repositories.index.advanced') %></span>
<span class="caret"></span>
</div>
</button>
<% if can_perform_repository_actions(@repository) %>
<ul class="dropdown-menu pull-right">
@ -80,7 +80,6 @@
<% end %>
</ul>
<% end %>
</div>
</div>