From f8bfd6fd3f0823bae90542d2b81302a865a2f0bd Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 8 Mar 2014 16:50:53 +0100 Subject: [PATCH] Coming soon thumbnail height fix --- couchpotato/core/media/movie/_base/static/movie.css | 1 + couchpotato/static/scripts/page/home.js | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/couchpotato/core/media/movie/_base/static/movie.css b/couchpotato/core/media/movie/_base/static/movie.css index a88a2077..b15b7ccf 100644 --- a/couchpotato/core/media/movie/_base/static/movie.css +++ b/couchpotato/core/media/movie/_base/static/movie.css @@ -127,6 +127,7 @@ margin: 0; padding: 0; vertical-align: top; + line-height: 0; } @media all and (max-width: 800px) { diff --git a/couchpotato/static/scripts/page/home.js b/couchpotato/static/scripts/page/home.js index dbf8d7b8..84033f15 100644 --- a/couchpotato/static/scripts/page/home.js +++ b/couchpotato/static/scripts/page/home.js @@ -106,10 +106,9 @@ Page.Home = new Class({ timer, highest = 100; - images.each(function(img_container){ - img_container.getElements('img').addEvent('load', function(){ - var img = this, - height = img.getSize().y; + images.each(function(img){ + img.addEvent('load', function(){ + var height = img.getSize().y; if(!highest || highest < height){ highest = height; if(timer) clearTimeout(timer); @@ -124,10 +123,8 @@ Page.Home = new Class({ if(timer) clearTimeout(timer); timer = (function(){ var highest = 100; - images.each(function(img_container){ - var img = img_container.getElement('img'); - if(!img) return - + images.each(function(img){ + img.setStyle('height', null); var height = img.getSize().y; if(!highest || highest < height) highest = height;