summaryrefslogtreecommitdiff
path: root/www/js/app.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2018-12-21 10:24:05 -0500
committerPliable Pixels <pliablepixels@gmail.com>2018-12-21 10:24:05 -0500
commita18aa84429258413b0e7adcd6c211f243ebefcf2 (patch)
treefc2d7611e0c02562c63e7f836b1da3cf6e023620 /www/js/app.js
parent71860e6fda10e4772fad034ba036e1b66198a17c (diff)
#766 - wait for rotation to complete or width/height will be wrong
Diffstat (limited to 'www/js/app.js')
-rwxr-xr-xwww/js/app.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/www/js/app.js b/www/js/app.js
index 6e400e94..f00bca93 100755
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -1727,11 +1727,18 @@ angular.module('zmApp', [
// http://stackoverflow.com/questions/1649086/detect-rotation-of-android-phone-in-the-browser-with-javascript
var checkOrientation = function () {
+
+ // give rotation time to actually rotate, or width/height will be bogus
+ $timeout ( function() {
+
var pixelRatio = window.devicePixelRatio || 1;
$rootScope.pixelRatio = pixelRatio;
$rootScope.devWidth = ((window.innerWidth > 0) ? window.innerWidth : screen.width);
$rootScope.devHeight = ((window.innerHeight > 0) ? window.innerHeight : screen.height);
- //console.log("********NEW Computed Dev Width & Height as" + $rootScope.devWidth + "*" + $rootScope.devHeight);
+
+ // console.log("********NEW Computed Dev Width & Height as" + $rootScope.devWidth + "*" + $rootScope.devHeight);
+ },300);
+
};