From 33df47b867fd5f8b14cebeb6d53449cc4e68c117 Mon Sep 17 00:00:00 2001
From: Manuel Garcia <manuel.drupal@gmail.com>
Date: Tue, 15 Mar 2011 18:16:07 +0100
Subject: [PATCH] Issue #1002094 by Manuel Garcia, deepM: Make slides height dinamic, thus allowing the use of portrait image styles in slides.

---
 theme/galleryformatter.js |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/theme/galleryformatter.js b/theme/galleryformatter.js
index 399d816..626513c 100644
--- a/theme/galleryformatter.js
+++ b/theme/galleryformatter.js
@@ -57,6 +57,8 @@ Drupal.galleryformatter.prepare = function(el) {
         $(this).parent().addClass('active');
         $slides.filter(':visible').fadeOut('slow');
         $hash.fadeIn('slow');
+        // set the slide container's height to allow use of portrait images
+        $slideContainer.css("height",$hash.find('img').height());
         /*
          * @FIXME
          * Need to figure out a way to update the location bar of the browser, for bookmarking etc, without making the scroll jump
@@ -85,6 +87,8 @@ Drupal.galleryformatter.prepare = function(el) {
       if ($slideToShow.length > 0) {
         $slideToShow.show(); //  show that slide
         $thumbsLi.not($(".cloned")).find("a[href="+$locationHash+"]").parent().addClass('active'); // activate that thumbnail
+        // set the slide container's height to allow use of portrait images
+        $slideContainer.css("height", $slideToShow.find('img').height());
       }
       // otherwise the default
       else {
-- 
1.7.1

