mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Reset modal image when a new image is uploaded
This commit is contained in:
parent
c2d33588d0
commit
bc3be635ae
@ -158,6 +158,12 @@
|
||||
function reloadImage(data) {
|
||||
if (data.image) {
|
||||
$('#company-image').attr('src', data.image);
|
||||
|
||||
// Reset the "modal image" view
|
||||
$('#company-image').click(function() {
|
||||
showModalImage(data.image);
|
||||
});
|
||||
|
||||
} else {
|
||||
location.reload();
|
||||
}
|
||||
|
@ -328,6 +328,12 @@
|
||||
// If image / thumbnail data present, live update
|
||||
if (data.image) {
|
||||
$('#part-image').attr('src', data.image);
|
||||
|
||||
// Reset the "modal image" view
|
||||
$('#part-thumb').click(function() {
|
||||
showModalImage(data.image);
|
||||
});
|
||||
|
||||
} else {
|
||||
// Otherwise, reload the page
|
||||
location.reload();
|
||||
|
Loading…
Reference in New Issue
Block a user