diff options
| author | Chad Kieffer <chad@2tbsp.com> | 2009-01-13 04:27:35 +0000 | 
|---|---|---|
| committer | Chad Kieffer <chad@2tbsp.com> | 2009-01-13 04:27:35 +0000 | 
| commit | ac59df23958d206956e92b4761c70214f8ffee8e (patch) | |
| tree | 037cf830dfd09c9b6eceed07ff7b2f87b1bb9416 /themes/default | |
| parent | 03e31ed5cc0bccb4b2e518089884cd75f1f5c242 (diff) | |
Fixed vertical alignment of thumbs.
Diffstat (limited to 'themes/default')
| -rw-r--r-- | themes/default/js/ui.init.js | 25 | 
1 files changed, 7 insertions, 18 deletions
| diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js index c6907959..fc0c45af 100644 --- a/themes/default/js/ui.init.js +++ b/themes/default/js/ui.init.js @@ -11,12 +11,7 @@ var shortForms = new Array(  $(document).ready(function() { -  // Initilize menus -  //http://docs.jquery.com/UI/Menu -  //http://docs.jquery.com/UI/Menu/menu < options -  // http://jquery-ui.googlecode.com/svn/branches/dev/menu/ui/ui.menu.js -  //$("#gSiteMenu").menu(); -   +  // Initilize menus      $("ul.gMenu").addClass("sf-menu");    $("#gViewMenu ul.gMenu").addClass("sf-menu"); @@ -33,7 +28,7 @@ $(document).ready(function() {    // Album view only    if ($("#gAlbumGrid").length) {      // Vertical align thumbnails/metadata in album grid -    $('.gItem div').vAlign(); +    $('.gItem').vAlign();    }    // Photo/Item item view only @@ -67,19 +62,14 @@ $(document).ready(function() {  (function ($) {    $.fn.vAlign = function(container) {      return this.each(function(i){ -     if(container == null) { -       container = 'div'; +      if (container == null) { +        container = 'div';        } -      var paddingPx = 10; //change this value as you need (It is the extra height for the parent element)        $(this).html("<" + container + ">" + $(this).html() + "</" + container + ">");        var el = $(this).children(container + ":first"); -      var elh = $(el).height(); //new element height -      var ph = $(this).height(); //parent height -      if(elh > ph) { //if new element height is larger apply this to parent -        $(this).height(elh + paddingPx); -       ph = elh + paddingPx; -      } -      var nh = (ph - elh) / 2; //new margin to apply +      var elh = $(el).height(); +      var ph = $(this).height(); +      var nh = (ph - elh) / 2;        $(el).css('margin-top', nh);      });    }; @@ -138,4 +128,3 @@ function shortFormInit(formID) {      }    });  } - | 
