Reset modal image when a new image is uploaded

This commit is contained in:
Oliver 2021-10-06 21:03:40 +11:00
parent c2d33588d0
commit bc3be635ae
2 changed files with 12 additions and 0 deletions

View File

@ -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();
}

View File

@ -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();