From c51b6ab38d7f16d64127fd3a73df38166a698f0f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 4 Sep 2010 15:54:07 -0700 Subject: Fix full size dimensions after rotating an image on the photo view page. The photo view page caches the dimensions of the full size and then renders it in Javascript. But after rotation, those dimensions are no longer valid. Create a new function on the items controller that returns the appropriate dimensions, then add a hook on $.gallery_replace_image and implement the hook on the photo view page to have it make an async call to get the new dimensions. Fixes ticket #1317 --- lib/gallery.common.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/gallery.common.js b/lib/gallery.common.js index a8b237bf..69452f39 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -121,6 +121,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); + } }; // Initialize context menus -- cgit v1.2.3