From 509010517790d55cb78f95b3cf415345f69f572f Mon Sep 17 00:00:00 2001 From: Simon Eisenmann Date: Tue, 15 Apr 2014 11:46:18 +0200 Subject: [PATCH] Fixed video bottom overflow in certain window sizes. --- static/js/directives/audiovideo.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/static/js/directives/audiovideo.js b/static/js/directives/audiovideo.js index f45bbac2..2c84ceb8 100644 --- a/static/js/directives/audiovideo.js +++ b/static/js/directives/audiovideo.js @@ -306,8 +306,11 @@ define(['jquery', 'underscore', 'text!partials/audiovideo.html', 'text!partials/ var singleVideoHeight = Math.ceil(singleVideoWidth/aspectRatio); var newContainerWidth = (videosPerRow*singleVideoWidth); var newContainerHeight = Math.ceil(videos.length/videosPerRow)*singleVideoHeight; - if (newContainerHeight*1.3 <= innerHeight) { - newContainerHeight = newContainerHeight*1.3; + if (newContainerHeight > innerHeight) { + var tooHigh = (newContainerHeight-innerHeight) / Math.ceil(videos.length / videosPerRow); + singleVideoHeight -= tooHigh; + singleVideoWidth = singleVideoHeight * aspectRatio; + newContainerHeight = innerHeight; } /* console.log("space", space);