mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Better UX when saving notes
This commit is contained in:
parent
34ec78649b
commit
87f2ebced1
@ -476,12 +476,15 @@ function setupNotesField(element, url, options={}) {
|
||||
|
||||
data[options.notes_field || 'notes'] = mde.value();
|
||||
|
||||
$('#save-notes').find('#save-icon').removeClass('fa-save').addClass('fa-spin fa-spinner');
|
||||
|
||||
inventreePut(url, data, {
|
||||
method: 'PATCH',
|
||||
success: function(response) {
|
||||
showMessage('{% trans "Notes updated" %}', {style: 'success'});
|
||||
$('#save-notes').find('#save-icon').removeClass('fa-spin fa-spinner').addClass('fa-check-circle');
|
||||
},
|
||||
error: function(xhr) {
|
||||
$('#save-notes').find('#save-icon').removeClass('fa-spin fa-spinner').addClass('fa-times-circle icon-red');
|
||||
showApiError(xhr, url);
|
||||
}
|
||||
});
|
||||
|
@ -1,8 +1,8 @@
|
||||
{% load i18n %}
|
||||
|
||||
<button type='button' id='edit-notes' title='{% trans "Edit" %}' class='btn btn-primary'>
|
||||
<span class='fas fa-edit'></span> {% trans "Edit" %}
|
||||
<span id='edit-icon' class='fas fa-edit'></span> {% trans "Edit" %}
|
||||
</button>
|
||||
<button type='button' id='save-notes' title='{% trans "Save" %}' class='btn btn-success' style='display: none;'>
|
||||
<span class='fas fa-save'></span> {% trans "Save" %}
|
||||
<span id='save-icon' class='fas fa-save'></span> {% trans "Save" %}
|
||||
</button>
|
||||
|
Loading…
Reference in New Issue
Block a user