diff --git a/InvenTree/InvenTree/static/script/inventree/notification.js b/InvenTree/InvenTree/static/script/inventree/notification.js index 399ba1d359..f6bdf3bc57 100644 --- a/InvenTree/InvenTree/static/script/inventree/notification.js +++ b/InvenTree/InvenTree/static/script/inventree/notification.js @@ -1,7 +1,7 @@ /* * Add a cached alert message to sesion storage */ -function addCachedAlert(message, style) { +function addCachedAlert(message, options={}) { var alerts = sessionStorage.getItem('inventree-alerts'); @@ -13,7 +13,8 @@ function addCachedAlert(message, style) { alerts.push({ message: message, - style: style + style: options.style || 'success', + icon: options.icon, }); sessionStorage.setItem('inventree-alerts', JSON.stringify(alerts)); @@ -31,13 +32,13 @@ function clearCachedAlerts() { /* * Display an alert, or cache to display on reload */ -function showAlertOrCache(message, style, cache=false) { +function showAlertOrCache(message, cache, options={}) { if (cache) { - addCachedAlert(message, style); + addCachedAlert(message, options); } else { - showMessage(message, {style: style}); + showMessage(message, options); } } @@ -50,7 +51,13 @@ function showCachedAlerts() { var alerts = JSON.parse(sessionStorage.getItem('inventree-alerts')) || []; alerts.forEach(function(alert) { - showMessage(alert.message, {style: alert.style}); + showMessage( + alert.message, + { + style: alert.style || 'success', + icon: alert.icon, + } + ); }); clearCachedAlerts(); diff --git a/InvenTree/company/templates/company/supplier_part.html b/InvenTree/company/templates/company/supplier_part.html index 52742cf488..276a9f7ebc 100644 --- a/InvenTree/company/templates/company/supplier_part.html +++ b/InvenTree/company/templates/company/supplier_part.html @@ -134,7 +134,15 @@ src="{% static 'img/blank_image.png' %}"