diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-09-10 08:41:12 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-09-10 08:41:12 -0700 |
commit | 3936183446375e039cc35eec80e427849336c210 (patch) | |
tree | 5983bea3adbf355a117224eeecc1d668cac1de75 | |
parent | d698a19e0e9acdcb81c5245d1f681546b604a1f3 (diff) | |
parent | 6e62d604a45b9bf1a60d04effb7eb08e7d15463c (diff) |
Merge branch 'master' of github.com:gallery/gallery3
-rw-r--r-- | lib/gallery.common.js | 16 | ||||
-rw-r--r-- | modules/organize/lib/Gallery3WebClient.swf | bin | 148920 -> 148926 bytes | |||
-rw-r--r-- | themes/wind/js/ui.init.js | 7 | ||||
-rw-r--r-- | themes/wind/views/photo.html.php | 4 |
4 files changed, 18 insertions, 9 deletions
diff --git a/lib/gallery.common.js b/lib/gallery.common.js index 69452f39..548b2e7c 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -24,8 +24,12 @@ if (container == null) { container = 'div'; } - $(this).html("<" + container + " class=\"g-valign\">" + $(this).html() + "</" + container + ">"); - var el = $(this).children(container + ".g-valign"); + var el = $(this).find(".g-valign"); + if (!el.length) { + $(this).html("<" + container + " class=\"g-valign\">" + $(this).html() + + "</" + container + ">"); + el = $(this).children(container + ".g-valign"); + } var elh = $(el).height(); var ph = $(this).height(); var nh = (ph - elh) / 2; @@ -119,11 +123,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/modules/organize/lib/Gallery3WebClient.swf b/modules/organize/lib/Gallery3WebClient.swf Binary files differindex 71daa2f9..356a1a2f 100644 --- a/modules/organize/lib/Gallery3WebClient.swf +++ b/modules/organize/lib/Gallery3WebClient.swf diff --git a/themes/wind/js/ui.init.js b/themes/wind/js/ui.init.js index a4fc0e2f..e5071dc1 100644 --- a/themes/wind/js/ui.init.js +++ b/themes/wind/js/ui.init.js @@ -90,9 +90,16 @@ $(document).ready(function() { $(this).css("top", 0).css("left", 0); // Remove the placeholder and hover class from the item $(this).removeClass("g-hover-item"); + $(this).gallery_valign(); $("#g-place-holder").remove(); } ); + + // Realign any thumbnails that change so that when we rotate a thumb it stays centered. + $(".g-item").bind("gallery.change", function() { + $(this).height($(this).find("img").height() + 2); + $(".g-item").equal_heights().gallery_valign(); + }); } // Photo/Item item view 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 ?> |