diff --git a/app/assets/javascripts/repositories/show.js b/app/assets/javascripts/repositories/show.js index 2ad89ca61..091d42d76 100644 --- a/app/assets/javascripts/repositories/show.js +++ b/app/assets/javascripts/repositories/show.js @@ -17,6 +17,8 @@ var formGroup = $('#form-records-file').find('.form-group'); formGroup.addClass('has-error'); formGroup.find('.help-block').remove(); + $('#form-records-file input[type="submit"]').removeAttr('disabled'); + $('#parse-sheet-loader').addClass('hidden'); formGroup.append( '' + XHR.responseJSON.message + '' ); @@ -24,6 +26,8 @@ } function handleSuccessfulSubmit(data) { + $('#form-records-file input[type="submit"]').removeAttr('disabled'); + $('#parse-sheet-loader').addClass('hidden'); $('#modal-import-records').modal('hide'); $(data.html).appendTo('body').promise().done(function() { $('#parse-records-modal').modal('show'); @@ -54,6 +58,8 @@ submitBtn.on('click', function(event) { var data = new FormData(); + submitBtn.attr('disabled', true); + $('#parse-sheet-loader').removeClass('hidden'); event.preventDefault(); event.stopPropagation(); data.append('file', document.getElementById('file').files[0]); diff --git a/app/views/repositories/_import_repository_records_modal.html.erb b/app/views/repositories/_import_repository_records_modal.html.erb index da7033fd6..0345c81dc 100644 --- a/app/views/repositories/_import_repository_records_modal.html.erb +++ b/app/views/repositories/_import_repository_records_modal.html.erb @@ -19,6 +19,7 @@ <%= t('repositories.modal_import.limit_description_html') %> +