From 87f2ebced17e79aa8903e82f66647e5bc1732c7d Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 17 Apr 2023 17:11:56 +1000 Subject: [PATCH] Better UX when saving notes --- InvenTree/templates/js/translated/helpers.js | 5 ++++- InvenTree/templates/notes_buttons.html | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/InvenTree/templates/js/translated/helpers.js b/InvenTree/templates/js/translated/helpers.js index ab688d75cd..4f7aa2de4b 100644 --- a/InvenTree/templates/js/translated/helpers.js +++ b/InvenTree/templates/js/translated/helpers.js @@ -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); } }); diff --git a/InvenTree/templates/notes_buttons.html b/InvenTree/templates/notes_buttons.html index a4072074f9..5c808141bf 100644 --- a/InvenTree/templates/notes_buttons.html +++ b/InvenTree/templates/notes_buttons.html @@ -1,8 +1,8 @@ {% load i18n %}