From 1c76c86d61037233f333ab7ef4e09883f87443c8 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Mon, 26 Oct 2020 14:22:39 -0400 Subject: fix screen orientation (shows as undefined) --- www/js/EventCtrl.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'www') diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index ea741a6d..56691f69 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -94,12 +94,13 @@ angular.module('zmApp.controllers') recomputeRowHeights(); $ionicScrollDelegate.resize(); - NVR.debug("screen.orientation.type: " + screen.orientation.type); - if (currOrientation != screen.orientation.type) { + var orientation = (screen.orientation || {}).type || screen.mozOrientation || screen.msOrientation; + NVR.debug("orientation: " + orientation); + if (currOrientation != orientation) { //$scope.$apply(); NVR.debug("sizechanged, scroll to item: " + currEventNum + ", postion: " + currEventPos); scrollTo(currEventNum, currEventPos); - currOrientation = screen.orientation.type; + currOrientation = orientation; } else { $timeout (function() { navTitle(); -- cgit v1.2.3