mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +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'>
|
<button type='button' class='btn btn-primary' id='bom-upload'>
|
||||||
<span class='fas fa-file-upload'></span> {% trans "Upload BOM File" %}
|
<span class='fas fa-file-upload'></span> {% trans "Upload BOM File" %}
|
||||||
</button>
|
</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;'>
|
<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>
|
</button>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
@ -210,6 +210,10 @@ function submitBomTable(part_id, options={}) {
|
|||||||
getApiEndpointOptions(url, function(response) {
|
getApiEndpointOptions(url, function(response) {
|
||||||
var fields = response.actions.POST;
|
var fields = response.actions.POST;
|
||||||
|
|
||||||
|
// Disable the "Submit BOM" button
|
||||||
|
$('#bom-submit').prop('disabled', true);
|
||||||
|
$('#bom-submit-icon').show();
|
||||||
|
|
||||||
inventreePut(url, data, {
|
inventreePut(url, data, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
@ -224,6 +228,10 @@ function submitBomTable(part_id, options={}) {
|
|||||||
showApiError(xhr, url);
|
showApiError(xhr, url);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Re-enable the submit button
|
||||||
|
$('#bom-submit').prop('disabled', false);
|
||||||
|
$('#bom-submit-icon').hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user