From 32878ebfdce943271824891639ab0384053bbadd Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 9 Sep 2010 21:04:18 -0700 Subject: Replace the hook function hack I introduced in cbba45fffc7368280e9529f55e108d0080175b6a with a namespaced jQuery custom event. This is way more portable. --- lib/gallery.common.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/gallery.common.js') 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 -- cgit v1.2.3