mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Disable "submit" button to prevent multiple simultaneous uploads
This commit is contained in:
parent
d38a8adf4c
commit
ffb319e136
@ -22,8 +22,11 @@
|
||||
<button type='button' class='btn btn-primary' id='bom-upload'>
|
||||
<span class='fas fa-file-upload'></span> {% trans "Upload BOM File" %}
|
||||
</button>
|
||||
<button type='button' class='btn btn-success' disabled='true' id='bom-submit-icon' style='display: none;'>
|
||||
<span class="fas fa-spin fa-circle-notch"></span>
|
||||
</button>
|
||||
<button type='button' class='btn btn-success' id='bom-submit' style='display: none;'>
|
||||
<span class='fas fa-sign-in-alt'></span> {% trans "Submit BOM Data" %}
|
||||
<span class='fas fa-sign-in-alt' id='bom-submit-icon'></span> {% trans "Submit BOM Data" %}
|
||||
</button>
|
||||
{% endblock %}
|
||||
|
||||
|
@ -210,6 +210,10 @@ function submitBomTable(part_id, options={}) {
|
||||
getApiEndpointOptions(url, function(response) {
|
||||
var fields = response.actions.POST;
|
||||
|
||||
// Disable the "Submit BOM" button
|
||||
$('#bom-submit').prop('disabled', true);
|
||||
$('#bom-submit-icon').show();
|
||||
|
||||
inventreePut(url, data, {
|
||||
method: 'POST',
|
||||
success: function(response) {
|
||||
@ -224,6 +228,10 @@ function submitBomTable(part_id, options={}) {
|
||||
showApiError(xhr, url);
|
||||
break;
|
||||
}
|
||||
|
||||
// Re-enable the submit button
|
||||
$('#bom-submit').prop('disabled', false);
|
||||
$('#bom-submit-icon').hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user