summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Kieffer <ckieffer@gmail.com>2009-09-27 22:49:46 -0600
committerChad Kieffer <ckieffer@gmail.com>2009-09-27 22:49:46 -0600
commit6cd8679dec24cd643fa3c2d9bdbf6ac8b938600c (patch)
tree10b2387f208565a7a48444da7169897201811d2b
parent8060a8a6594c8bc089098329c52bd1d42a0c7adb (diff)
Set .gItem height dynamically based on the tallest item in the grid. Addresses ticket #757
-rw-r--r--lib/gallery.common.js12
-rw-r--r--themes/wind/css/screen.css2
-rw-r--r--themes/wind/js/ui.init.js4
3 files changed, 14 insertions, 4 deletions
diff --git a/lib/gallery.common.js b/lib/gallery.common.js
index 618c556e..a91f021e 100644
--- a/lib/gallery.common.js
+++ b/lib/gallery.common.js
@@ -6,6 +6,18 @@
});
};
+ // Make the height of all items the same as the tallest item within the set
+ $.fn.equal_heights = function() {
+ var tallest_height = 0;
+ $(this).each(function(){
+ if ($(this).height() > tallest_height) {
+ tallest_height = $(this).height();
+ }
+ });
+ return $(this).height(tallest_height);
+ };
+
+
// Vertically align a block element's content
$.fn.gallery_valign = function(container) {
return this.each(function(i){
diff --git a/themes/wind/css/screen.css b/themes/wind/css/screen.css
index c4b33b35..df46b443 100644
--- a/themes/wind/css/screen.css
+++ b/themes/wind/css/screen.css
@@ -449,8 +449,6 @@ form .gError,
border: 1px solid #fff;
float: left;
font-size: .7em;
- height: 220px;
- overflow: hidden;
padding: .6em 8px;
position: relative;
text-align: center;
diff --git a/themes/wind/js/ui.init.js b/themes/wind/js/ui.init.js
index cb765552..c79e91bd 100644
--- a/themes/wind/js/ui.init.js
+++ b/themes/wind/js/ui.init.js
@@ -59,8 +59,8 @@ $(document).ready(function() {
// Album view only
if ($("#gAlbumGrid").length) {
- // Vertical align thumbnails/metadata in album grid
- $(".gItem").gallery_valign();
+ // Set equal height for album items and vertically align thumbnails/metadata
+ $('.gItem').equal_heights().gallery_valign();
// Initialize thumbnail hover effect
$(".gItem").hover(