only run adjustRatio after image is loaded

This commit is contained in:
j 2018-05-09 17:27:52 +01:00
parent 2727c3d27d
commit 6c1aa50ed2

View file

@ -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',
})
}
}
}