From 83400033a3b7a91ad072a5d306355c9cd5a80d82 Mon Sep 17 00:00:00 2001 From: PliablePixels Date: Fri, 24 Jul 2015 15:48:01 -0400 Subject: integrated event scrubbing with direct image access - need to clean up code --- www/js/app.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'www/js/app.js') diff --git a/www/js/app.js b/www/js/app.js index 40280917..f676bfb3 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -9,9 +9,7 @@ angular.module('zmApp', [ 'ionic', 'tc.chartjs', 'zmApp.controllers', - 'fileLogger', - - + 'fileLogger' ]) // ------------------------------------------ @@ -201,6 +199,8 @@ angular.module('zmApp', [ .run(function ($ionicPlatform, $ionicPopup, $rootScope, zm, $state, ZMDataModel, $cordovaSplashscreen, $http, $interval, zmAutoLogin, $fileLogger,$timeout, $ionicHistory, $window, $ionicSideMenuDelegate) { + + ZMDataModel.init(); var loginData = ZMDataModel.getLogin(); @@ -208,6 +208,7 @@ angular.module('zmApp', [ ZMDataModel.zmLog ("User is logged in"); console.log("VALID CREDENTIALS. Grabbing Monitors"); ZMDataModel.getMonitors(0); + ZMDataModel.getKeyConfigParams(1); } @@ -216,9 +217,10 @@ angular.module('zmApp', [ // MenuDelegate always returns False, so I don't know // when its on or off, so can't exit the app if its on - $ionicPlatform.registerBackButtonAction(function (event) { - $ionicSideMenuDelegate.toggleLeft(); -}, 100); + + + + // this works reliably on both Android and iOS. The "onorientation" seems to reverse w/h in Android. Go figure. // http://stackoverflow.com/questions/1649086/detect-rotation-of-android-phone-in-the-browser-with-javascript @@ -302,12 +304,18 @@ angular.module('zmApp', [ } - setTimeout(function () { + /*setTimeout(function () { if (window.cordova) { $cordovaSplashscreen.hide(); } - }, 1500); + }, 1500);*/ + + if(window.navigator && window.navigator.splashscreen) { + window.navigator.splashscreen.hide(); + console.log ("Unlocking portrait mode after splash"); + window.plugins.orientationLock.unlock(); + } var pixelRatio = window.devicePixelRatio || 1; $rootScope.devWidth = ((window.innerWidth > 0) ? window.innerWidth : screen.width); -- cgit v1.2.3