Remove screen size field

This commit is contained in:
Victor 2015-12-06 20:24:05 +02:00
parent 4a0591f8b0
commit 1583fd741c

View File

@ -2,8 +2,6 @@
function Views(parser) { function Views(parser) {
this.parser = parser; this.parser = parser;
this.screenWidth = window.innerWidth;
this.screenHeight = window.innerHeight;
this.windowTag = document.getElementById("window"); this.windowTag = document.getElementById("window");
this.textAuthorTag = document.getElementById("textAuthor"); this.textAuthorTag = document.getElementById("textAuthor");
@ -127,7 +125,7 @@ Views.prototype.sprite = function (whoid, params, position, alias, effect) {
} else { } else {
//if (this.useSpriteTransitions) img = new AnimatableImageView(this); //if (this.useSpriteTransitions) img = new AnimatableImageView(this);
//else img = new ImageView(this); //else img = new ImageView(this);
img = $('<img>', {class: "sprite", style: "height: " + this.screenHeight + "px;" }); img = $('<img>', {class: "sprite", style: "height: " + window.innerHeight + "px;" });
this.spriteInContainer[key] = img; this.spriteInContainer[key] = img;
} }
var path = PathResolver.sprite(whoid, params); var path = PathResolver.sprite(whoid, params);
@ -176,7 +174,7 @@ Views.prototype.hide = function (whoid, effect) {
}; };
Views.prototype.setSpritePosition = function (img, position) { Views.prototype.setSpritePosition = function (img, position) {
var width = this.screenWidth; var width = window.innerWidth;
var imgWidth = img.width(); var imgWidth = img.width();
if (TextUtils.isEmpty(position) || position.equals("center")) { if (TextUtils.isEmpty(position) || position.equals("center")) {
img.css("left", Math.floor(width / 2 - imgWidth / 2) + "px"); img.css("left", Math.floor(width / 2 - imgWidth / 2) + "px");