From a18aa84429258413b0e7adcd6c211f243ebefcf2 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Fri, 21 Dec 2018 10:24:05 -0500 Subject: #766 - wait for rotation to complete or width/height will be wrong --- www/js/app.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'www/js/app.js') 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); + }; -- cgit v1.2.3