Reset modal image when a new image is uploaded

This commit is contained in:
Oliver committed 2021-10-06 21:03:40 +11:00
1 parent c2d33588d0
commit bc3be635ae
2 files changed
+12

No files matched your search

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