From 6f1a1f8aa047728bb3aa6cc5f19ee58ded9fe655 Mon Sep 17 00:00:00 2001 From: pabloalcaraz Date: Thu, 3 Apr 2014 20:14:31 +0200 Subject: [PATCH] Fix when the CSS style width/height has percentage When the style has a percentage width() or height returns NaN. With the computedStyle function instead of css ensures that return pixels. --- appframework.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appframework.js b/appframework.js index 88ffb3d8b..62dc21b45 100755 --- a/appframework.js +++ b/appframework.js @@ -1240,7 +1240,7 @@ if (!window.af || typeof(af) !== "function") { if (this[0].nodeType === this[0].DOCUMENT_NODE) return this[0].documentElement.offsetHeight; else { - var tmpVal = this.css("height").replace("px", ""); + var tmpVal = this.computedStyle("height").replace("px", ""); if (tmpVal) return +tmpVal; else @@ -1265,7 +1265,7 @@ if (!window.af || typeof(af) !== "function") { if (this[0].nodeType === this[0].DOCUMENT_NODE) return this[0].documentElement.offsetWidth; else { - var tmpVal = this.css("width").replace("px", ""); + var tmpVal = this.computedStyle("width").replace("px", ""); if (tmpVal) return +tmpVal; else