From 5d51dc48b6e1b4b2c29db4498c98a5b36a7fc330 Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 15 Dec 2015 14:16:14 +0200 Subject: [PATCH] Fix size calculations based on #background size, not window --- public_html/js/Views.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public_html/js/Views.js b/public_html/js/Views.js index e40c0be..24e7f9e 100644 --- a/public_html/js/Views.js +++ b/public_html/js/Views.js @@ -152,7 +152,7 @@ Views.prototype.sprite = function (whoid, params, position, alias, effect) { } else { //if (this.useSpriteTransitions) img = new AnimatableImageView(this); //else img = new ImageView(this); - img = $('', {class: "sprite", style: "height: " + window.innerHeight + "px;" }); + img = $('', {class: "sprite", style: "height: " + $('#background').outerHeight(true) + "px;" }); this.spriteInContainer[key] = img; } var path = PathResolver.sprite(whoid, params); @@ -205,7 +205,7 @@ Views.prototype.hide = function (whoid, effect) { }; Views.prototype.setSpritePosition = function (img, position) { - var width = window.innerWidth; + var width = $('#background').outerWidth(true); var imgWidth = img.width(); if (TextUtils.isEmpty(position) || position.equals("center")) { img.css("left", Math.floor(width / 2 - imgWidth / 2) + "px");