From 6211ed69d7a07d88b18c4db2928663c2cb76b1ba Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 9 Sep 2010 21:25:23 -0700 Subject: Vertically realign thumbnails after rotation so that they stay centered. Partial fix for #1354. --- themes/wind/js/ui.init.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'themes/wind/js/ui.init.js') diff --git a/themes/wind/js/ui.init.js b/themes/wind/js/ui.init.js index a4fc0e2f..7637ad80 100644 --- a/themes/wind/js/ui.init.js +++ b/themes/wind/js/ui.init.js @@ -93,6 +93,11 @@ $(document).ready(function() { $("#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).gallery_valign(); + }); } // Photo/Item item view -- cgit v1.2.3 From 6e62d604a45b9bf1a60d04effb7eb08e7d15463c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 9 Sep 2010 21:58:16 -0700 Subject: Resize the .g-item to contain the rotated image, and make all .g-item's the same height and realign the photo vertically, both on the .g-item and the hover placeholder. Fixes ticket #1354. --- themes/wind/js/ui.init.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'themes/wind/js/ui.init.js') diff --git a/themes/wind/js/ui.init.js b/themes/wind/js/ui.init.js index 7637ad80..e5071dc1 100644 --- a/themes/wind/js/ui.init.js +++ b/themes/wind/js/ui.init.js @@ -90,13 +90,15 @@ $(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).gallery_valign(); + $(this).height($(this).find("img").height() + 2); + $(".g-item").equal_heights().gallery_valign(); }); } -- cgit v1.2.3 From 304dd9cb51b3514f2e663674d22f0d73c0f3e583 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 10 Sep 2010 23:13:47 -0700 Subject: After replacing thumbnails, resize all .g-item boxes down to just a bit larger than the image and then do equal_heights() on them. This tightens the grid back up again when appropriate after a rotation. --- themes/wind/js/ui.init.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'themes/wind/js/ui.init.js') diff --git a/themes/wind/js/ui.init.js b/themes/wind/js/ui.init.js index e5071dc1..2c67bf3a 100644 --- a/themes/wind/js/ui.init.js +++ b/themes/wind/js/ui.init.js @@ -97,7 +97,9 @@ $(document).ready(function() { // 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").each(function() { + $(this).height($(this).find("img").height() + 2); + }); $(".g-item").equal_heights().gallery_valign(); }); } -- cgit v1.2.3