mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-09 21:36:44 +08:00
Merge pull request #7114 from artoscinote/ma_SCI_10240
Disable button and add loader when importing inventory items [SCI-10240]
This commit is contained in:
commit
425b189742
2 changed files with 7 additions and 0 deletions
|
@ -17,6 +17,8 @@
|
||||||
var formGroup = $('#form-records-file').find('.form-group');
|
var formGroup = $('#form-records-file').find('.form-group');
|
||||||
formGroup.addClass('has-error');
|
formGroup.addClass('has-error');
|
||||||
formGroup.find('.help-block').remove();
|
formGroup.find('.help-block').remove();
|
||||||
|
$('#form-records-file input[type="submit"]').removeAttr('disabled');
|
||||||
|
$('#parse-sheet-loader').addClass('hidden');
|
||||||
formGroup.append(
|
formGroup.append(
|
||||||
'<span class="help-block">' + XHR.responseJSON.message + '</span>'
|
'<span class="help-block">' + XHR.responseJSON.message + '</span>'
|
||||||
);
|
);
|
||||||
|
@ -24,6 +26,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSuccessfulSubmit(data) {
|
function handleSuccessfulSubmit(data) {
|
||||||
|
$('#form-records-file input[type="submit"]').removeAttr('disabled');
|
||||||
|
$('#parse-sheet-loader').addClass('hidden');
|
||||||
$('#modal-import-records').modal('hide');
|
$('#modal-import-records').modal('hide');
|
||||||
$(data.html).appendTo('body').promise().done(function() {
|
$(data.html).appendTo('body').promise().done(function() {
|
||||||
$('#parse-records-modal').modal('show');
|
$('#parse-records-modal').modal('show');
|
||||||
|
@ -54,6 +58,8 @@
|
||||||
|
|
||||||
submitBtn.on('click', function(event) {
|
submitBtn.on('click', function(event) {
|
||||||
var data = new FormData();
|
var data = new FormData();
|
||||||
|
submitBtn.attr('disabled', true);
|
||||||
|
$('#parse-sheet-loader').removeClass('hidden');
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
data.append('file', document.getElementById('file').files[0]);
|
data.append('file', document.getElementById('file').files[0]);
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
<span class="sn-icon sn-icon-info alert-icon"></span>
|
<span class="sn-icon sn-icon-info alert-icon"></span>
|
||||||
<span><%= t('repositories.modal_import.limit_description_html') %></span>
|
<span><%= t('repositories.modal_import.limit_description_html') %></span>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="parse-sheet-loader" class="sci-loader mt-4 hidden"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|
Loading…
Add table
Reference in a new issue