diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-09-09 21:25:23 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-09-09 21:25:23 -0700 |
commit | 6211ed69d7a07d88b18c4db2928663c2cb76b1ba (patch) | |
tree | bdef48a467b154aacd814fecae80a2c8c8b1aba5 /lib/gallery.common.js | |
parent | 32878ebfdce943271824891639ab0384053bbadd (diff) |
Vertically realign thumbnails after rotation so that they stay
centered. Partial fix for #1354.
Diffstat (limited to 'lib/gallery.common.js')
-rw-r--r-- | lib/gallery.common.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gallery.common.js b/lib/gallery.common.js index 9fccc602..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; |