summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/gallery.common.js8
-rw-r--r--themes/wind/views/photo.html.php4
2 files changed, 5 insertions, 7 deletions
diff --git a/lib/gallery.common.js b/lib/gallery.common.js
index 69452f39..9fccc602 100644
--- a/lib/gallery.common.js
+++ b/lib/gallery.common.js
@@ -119,11 +119,9 @@
};
// Ajax handler for replacing an image, used in Ajax thumbnail rotation
- $.gallery_replace_image = function(data, thumb) {
- $(thumb).attr({src: data.src, width: data.width, height: data.height});
- if (typeof gallery_image_replaced_hook == 'function') {
- gallery_image_replaced_hook(data, thumb);
- }
+ $.gallery_replace_image = function(data, img_selector) {
+ $(img_selector).attr({src: data.src, width: data.width, height: data.height});
+ $(img_selector).trigger("gallery.change");
};
// Initialize context menus
diff --git a/themes/wind/views/photo.html.php b/themes/wind/views/photo.html.php
index cb830e23..b42ab987 100644
--- a/themes/wind/views/photo.html.php
+++ b/themes/wind/views/photo.html.php
@@ -12,7 +12,7 @@
// After the image is rotated or replaced we have to reload the image dimensions
// so that the full size view isn't distorted.
- gallery_image_replaced_hook = function(data, thumb) {
+ $("#g-photo").bind("gallery.change", function() {
$.ajax({
url: "<?= url::site("items/dimensions/" . $theme->item()->id) ?>",
dataType: "json",
@@ -20,7 +20,7 @@
full_dims = data.full;
}
});
- }
+ });
});
</script>
<? endif ?>