From 70a073be21c08c1cf4a9b461866cc05d81cdb828 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 23 Jun 2021 19:28:23 +1000 Subject: [PATCH] Live update part image --- InvenTree/part/templates/part/part_base.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/InvenTree/part/templates/part/part_base.html b/InvenTree/part/templates/part/part_base.html index 6bb1320e5a..b486e2c589 100644 --- a/InvenTree/part/templates/part/part_base.html +++ b/InvenTree/part/templates/part/part_base.html @@ -244,7 +244,14 @@ label: 'image', method: 'PATCH', success: function(data, status, xhr) { - location.reload(); + + // If image / thumbnail data present, live update + if (data.image) { + $('#part-image').attr('src', data.image); + } else { + // Otherwise, reload the page + location.reload(); + } } } );