From 6c1aa50ed2e28a6758243adf52ad7ae06da24f15 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 9 May 2018 17:27:52 +0100 Subject: [PATCH] only run adjustRatio after image is loaded --- static/js/home.js | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/static/js/home.js b/static/js/home.js index 980151f9..e03983ce 100644 --- a/static/js/home.js +++ b/static/js/home.js @@ -261,20 +261,21 @@ pandora.ui.home = function() { var height = $logo.height(); if (width == 0 || height == 0) { setTimeout(adjustRatio, 50); - } - var aspect = width / height; - if (aspect != 2) { - var top = 320 / aspect; - $reflectionImage.css({ - top: top + 'px', - }) - $reflectionGradient.css({ - top: top + 'px', - height: (top + 2) + 'px', - }) - $logo.css({ - bottom: top + 'px', - }) + } else { + var aspect = width / height; + if (aspect != 2) { + var top = 320 / aspect; + $reflectionImage.css({ + top: top + 'px', + }) + $reflectionGradient.css({ + top: top + 'px', + height: (top + 2) + 'px', + }) + $logo.css({ + bottom: top + 'px', + }) + } } }