diff --git a/lib/gallery.common.js b/lib/gallery.common.js index 69452f39db..9fccc602e2 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 cb830e2347..b42ab9878a 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: "item()->id) ?>", dataType: "json", @@ -20,7 +20,7 @@ full_dims = data.full; } }); - } + }); });