summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorpliablepixels <pliablepixels@gmail.com>2016-06-03 14:55:30 -0400
committerpliablepixels <pliablepixels@gmail.com>2016-06-03 14:55:30 -0400
commita4fe7a944de098f30cd79251414769858669d6ad (patch)
tree9e9d0342ead9b3fc03a2842eee6e43f0c3cae30b /www/js
parent459918f354eacb00ce4c2cf096dfe51863b51916 (diff)
messing around with some layouts
Former-commit-id: 128a20b077eb519d01a7bcdacd507e7efe447a5d
Diffstat (limited to 'www/js')
-rw-r--r--www/js/DataModel.js11
-rw-r--r--www/js/EventCtrl.js2
-rw-r--r--www/js/LoginCtrl.js4
-rw-r--r--www/js/MontageCtrl.js86
-rw-r--r--www/js/app.js430
5 files changed, 157 insertions, 376 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index 512ae20c..fb28e729 100644
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -509,7 +509,8 @@ angular.module('zmApp.controllers')
if (typeof timelineModalGraphType == 'undefined')
{
zmDebug ("timeline graph type not set. Setting to all");
- loginData.timelineModalGraphType = $translate.instant('kAll');
+ loginData.timelineModalGraphType = $translate.instant('kGraphAll');
+ console.log (">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+loginData.timelineModalGraphType);
}
if (typeof loginData.resumeDelay == 'undefined')
@@ -592,18 +593,24 @@ angular.module('zmApp.controllers')
setDefaultLanguage: function(l, permanent) {
+ var d = $q.defer();
if (permanent)
window.localStorage.setItem("defaultLang", l);
$translate.use(l).then(function(data) {
zmLog("Device Language is:" + data);
moment.locale(data);
- $translate.fallbackLanguage('en');
+ $translate.fallbackLanguage('en');
+ d.resolve(data);
+ return d.promise;
}, function(error) {
zmLog("Device Language error: " + error);
$translate.use('en');
moment.locale('en');
+ d.resolve('en');
+ return d.promise;
});
+ return d.promise;
},
getDefaultLanguage: function() {
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js
index 69265aab..d842c4ed 100644
--- a/www/js/EventCtrl.js
+++ b/www/js/EventCtrl.js
@@ -7,7 +7,7 @@
// and whether the new API has a better mechanism
angular.module('zmApp.controllers')
- .controller('zmApp.EventCtrl', ['$scope', '$rootScope', 'zm', 'ZMDataModel', 'message', '$ionicSideMenuDelegate', '$timeout', '$interval', '$ionicModal', '$ionicLoading', '$http', '$state', '$stateParams', '$ionicHistory', '$ionicScrollDelegate', '$ionicPlatform', '$ionicSlideBoxDelegate', '$ionicPosition', '$ionicPopover', '$ionicPopup', 'EventServer', '$sce', '$cordovaBadge', '$cordovaLocalNotification', '$q', 'appModalService', 'carouselUtils', '$translate', function ($scope, $rootScope, zm, ZMDataModel, message, $ionicSideMenuDelegate, $timeout, $interval, $ionicModal, $ionicLoading, $http, $state, $stateParams, $ionicHistory, $ionicScrollDelegate, $ionicPlatform, $ionicSlideBoxDelegate, $ionicPosition, $ionicPopover, $ionicPopup, EventServer, $sce, $cordovaBadge, $cordovaLocalNotification, $q, appModalService, carouselUtils, $translate) {
+ .controller('zmApp.EventCtrl', ['$scope', '$rootScope', 'zm', 'ZMDataModel', 'message', '$ionicSideMenuDelegate', '$timeout', '$interval', '$ionicModal', '$ionicLoading', '$http', '$state', '$stateParams', '$ionicHistory', '$ionicScrollDelegate', '$ionicPlatform', '$ionicSlideBoxDelegate', '$ionicPosition', '$ionicPopover', '$ionicPopup', 'EventServer', '$sce', '$cordovaBadge', '$cordovaLocalNotification', '$q', 'carouselUtils', '$translate', function ($scope, $rootScope, zm, ZMDataModel, message, $ionicSideMenuDelegate, $timeout, $interval, $ionicModal, $ionicLoading, $http, $state, $stateParams, $ionicHistory, $ionicScrollDelegate, $ionicPlatform, $ionicSlideBoxDelegate, $ionicPosition, $ionicPopover, $ionicPopup, EventServer, $sce, $cordovaBadge, $cordovaLocalNotification, $q, carouselUtils, $translate) {
// events in last 5 minutes
// TODO https://server/zm/api/events/consoleEvents/5%20minute.json
diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js
index 3347bdb9..63ac65e0 100644
--- a/www/js/LoginCtrl.js
+++ b/www/js/LoginCtrl.js
@@ -61,7 +61,7 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r
var sheet = $ionicActionSheet.show({
buttons: ab,
titleText: $translate.instant('kSelectFallback'),
- cancelText: $translate.instant('kCancel'),
+ cancelText: $translate.instant('kButtonCancel'),
cancel: function() {},
buttonClicked: function (index)
{
@@ -88,7 +88,7 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r
buttons: serverbuttons,
destructiveText: $translate.instant('kDelete'),
titleText: $translate.instant('kManageServerGroups'),
- cancelText: $translate.instant('kCancel'),
+ cancelText: $translate.instant('kButtonCancel'),
cancel: function () {
// add cancel code..
},
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js
index 54ab982c..9f5ed051 100644
--- a/www/js/MontageCtrl.js
+++ b/www/js/MontageCtrl.js
@@ -131,22 +131,14 @@ function initPackery()
}
var elem = angular.element(document.getElementById("mygrid"));
- pckry = new Packery('.grid',
- {
- itemSelector: '.grid-item',
- percentPosition: true,
- columnWidth: '.grid-sizer',
- gutter:0,
- initLayout:layouttype
-
- });
+
//console.log ("**** mygrid is " + JSON.stringify(elem));
imagesLoaded(elem).on('progress', function(instance, img) {
progressCalled = true;
- if (layouttype) $timeout (function(){layout(pckry);},100);
+ // if (layouttype) $timeout (function(){layout(pckry);},100);
});
imagesLoaded(elem).on('always', function() {
@@ -154,10 +146,17 @@ function initPackery()
ZMDataModel.zmDebug ("All images loaded");
$scope.allImagesLoaded = true;
-
$ionicLoading.hide();
-
+ pckry = new Packery('.grid',
+ {
+ itemSelector: '.grid-item',
+ percentPosition: true,
+ columnWidth: '.grid-sizer',
+ gutter:0,
+ initLayout:layouttype
+
+ });
if (!progressCalled)
{
ZMDataModel.zmLog ("*** BUG PROGRESS WAS NOT CALLED");
@@ -165,44 +164,47 @@ function initPackery()
}
- pckry.getItemElements().forEach(function (itemElem) {
- draggie = new Draggabilly(itemElem);
- pckry.bindDraggabillyEvents(draggie);
- draggies.push(draggie);
- draggie.disable();
- draggie.unbindHandles();
- });
-
- pckry.on( 'dragItemPositioned', itemDragged );
+ $timeout (function() {
-
-
- if (!isEmpty(positions))
- {
- ZMDataModel.zmLog ("Arranging as per packery grid");
-
- for (var i =0; i< $scope.MontageMonitors.length; i++)
+ pckry.getItemElements().forEach(function (itemElem) {
+ draggie = new Draggabilly(itemElem);
+ pckry.bindDraggabillyEvents(draggie);
+ draggies.push(draggie);
+ draggie.disable();
+ draggie.unbindHandles();
+ });
+
+ pckry.on( 'dragItemPositioned', itemDragged );
+
+
+
+ if (!isEmpty(positions))
{
- for (var j=0; j < positions.length; j++)
+ ZMDataModel.zmLog ("Arranging as per packery grid");
+
+ for (var i =0; i< $scope.MontageMonitors.length; i++)
{
- if ($scope.MontageMonitors[i].Monitor.Id == positions[j].attr)
+ for (var j=0; j < positions.length; j++)
{
- $scope.MontageMonitors[i].Monitor.gridScale = positions[j].size;
- $scope.MontageMonitors[i].Monitor.listDisplay = positions[j].display;
- ZMDataModel.zmDebug ("Setting monitor ID: " + $scope.MontageMonitors[i].Monitor.Id + " to size: " +positions[j].size + " and display:" + positions[j].display);
+ if ($scope.MontageMonitors[i].Monitor.Id == positions[j].attr)
+ {
+ $scope.MontageMonitors[i].Monitor.gridScale = positions[j].size;
+ $scope.MontageMonitors[i].Monitor.listDisplay = positions[j].display;
+ ZMDataModel.zmDebug ("Setting monitor ID: " + $scope.MontageMonitors[i].Monitor.Id + " to size: " +positions[j].size + " and display:" + positions[j].display);
+ }
+ //console.log ("Index:"+positions[j].attr+ " with size: " + positions[j].size);
}
- //console.log ("Index:"+positions[j].attr+ " with size: " + positions[j].size);
}
+
+
+ ZMDataModel.zmDebug ("All images loaded, doing image layout");
+ pckry.initShiftLayout(positions, 'data-item-id');
}
-
-
- $timeout(function(){ZMDataModel.zmDebug ("All images loaded, doing image layout");pckry.initShiftLayout(positions, 'data-item-id'); },100);
- }
- $timeout(function(){ZMDataModel.zmLog ("Force calling resize"); pckry.onresize();},300);// don't ask
-
+ $timeout(function(){ZMDataModel.zmLog ("Force calling resize"); pckry.shiftLayout();},300);// don't ask
+
-
+ },300);
});
@@ -595,6 +597,8 @@ function initPackery()
ZMDataModel.zmDebug ("setting dragabilly to " + $scope.isDragabillyOn);
if ($scope.isDragabillyOn)
{
+ $scope.showSizeButtons = true;
+
$scope.dragBorder="dragborder";
ZMDataModel.zmDebug ("Enabling drag for " + draggies.length + " items");
for (i=0; i < draggies.length; i++)
diff --git a/www/js/app.js b/www/js/app.js
index 03b01c8f..32ebb9b9 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -1,6 +1,6 @@
/* jshint -W041 */
/* jslint browser: true*/
-/* global cordova,StatusBar,angular,console,alert,PushNotification, moment ,ionic, URI, ConnectSDK,$*/
+/* global cordova,StatusBar,angular,console,alert,PushNotification, moment ,ionic, URI,Packery, ConnectSDK,$*/
var appVersion = "0.0.0";
@@ -81,27 +81,26 @@ angular.module('zmApp', [
})
-// credit: http://stackoverflow.com/questions/25391279/angularjs-ng-include-failover
-.directive("ngIncludeFailover", function() {
- return {
- restrict: 'CAE',
- scope: {
- src: '=',
- myInclude: '='
- },
- transclude:true,
- link: function(scope, iElement, iAttrs, controller) {
- iAttrs.$observe('src', function (nv) {scope.src=nv; console.log ("CHANGED");});
- scope.$on("$includeContentError", function(event, args){
- scope.loadFailed=true;
- });
- scope.$on("$includeContentLoaded", function(event, args){
- scope.loadFailed=false;
- });
- },
- template: "<div ng-include='ngIncludeFailover||src'></div><div ng-show='loadFailed' ng-transclude/>"
- };
- })
+
+.directive('dannyPackery', ['$rootScope', function($rootScope) {
+ return {
+ restrict: 'A',
+ link: function(scope, element, attrs) {
+ console.log('Running dannyPackery linking function!');
+ if($rootScope.packery === undefined || $rootScope.packery === null){
+ console.log('making packery!');
+ $rootScope.packery = new Packery(element[0].parentElement, {columnWidth: '.item'});
+ $rootScope.packery.bindResize();
+ $rootScope.packery.appended(element[0]);
+ $rootScope.packery.items.splice(1,1); // hack to fix a bug where the first element was added twice in two different positions
+ }
+ else{
+ $rootScope.packery.appended(element[0]);
+ }
+ $rootScope.packery.layout();
+ }
+ };
+}])
// credit https://gist.github.com/Zren/beaafd64f395e23f4604
@@ -196,46 +195,6 @@ angular.module('zmApp', [
})
-.directive('detectGestures', function ($ionicGesture) {
- return {
- restrict: 'A',
-
- link: function (scope, elem, attrs) {
- var gestureType = attrs.gestureType;
-
- switch (gestureType) {
- case 'pinchin':
- $ionicGesture.on('pinchin', scope.reportEvent, elem);
- break;
- }
-
- }
- };
-})
-
-.directive('tooltip', function () {
- return {
- restrict: 'C',
- link: function (scope, element, attrs) {
- if (attrs.title) {
- var $element = $(element);
- $element.attr("title", attrs.title);
- $element.tooltipster({
- animation: attrs.animation,
- trigger: "click",
- position: "right",
- positionTracker: true,
- maxWidth: 500,
- contentAsHTML: true
- });
- }
- }
- };
-})
-
-
-
-
//------------------------------------------------------------------
// I use this factory to share data between carousel and lazy load
// carousel will not progress autoslide till imageLoading is 0 or -1
@@ -254,113 +213,6 @@ angular.module('zmApp', [
};
})
-//-------------------------------------------------------
-// Ability to share controllers with modals
-// Credit: http://codepen.io/julianpaulozzi/pen/wBgpjM
-//-------------------------------------------------------
-
-.factory('appModalService', ['$ionicModal', '$rootScope', '$q', '$injector', '$controller', function ($ionicModal, $rootScope, $q, $injector, $controller) {
-
- return {
- show: show
- };
-
- function show(templateUrl, controller, parameters, options) {
- // Grab the injector and create a new scope
- var deferred = $q.defer(),
- ctrlInstance,
- modalScope = $rootScope.$new(),
- thisScopeId = modalScope.$id,
- defaultOptions = {
- animation: 'slide-in-up',
- focusFirstInput: false,
- backdropClickToClose: true,
- hardwareBackButtonClose: true,
- modalCallback: null
- };
-
- options = angular.extend({}, defaultOptions, options);
-
- $ionicModal.fromTemplateUrl(templateUrl, {
- scope: modalScope,
- animation: options.animation,
- focusFirstInput: options.focusFirstInput,
- backdropClickToClose: options.backdropClickToClose,
- hardwareBackButtonClose: options.hardwareBackButtonClose
- }).then(function (modal) {
- modalScope.modal = modal;
-
- modalScope.openModal = function () {
- modalScope.modal.show();
- };
- modalScope.closeModal = function (result) {
- deferred.resolve(result);
- modalScope.modal.hide();
- };
- modalScope.$on('modal.hidden', function (thisModal) {
- if (thisModal.currentScope) {
- var modalScopeId = thisModal.currentScope.$id;
- if (thisScopeId === modalScopeId) {
- deferred.resolve(null);
- _cleanup(thisModal.currentScope);
- }
- }
- });
-
- // Invoke the controller
- var locals = {
- '$scope': modalScope,
- 'parameters': parameters
- };
- var ctrlEval = _evalController(controller);
- ctrlInstance = $controller(controller, locals);
- if (ctrlEval.isControllerAs) {
- ctrlInstance.openModal = modalScope.openModal;
- ctrlInstance.closeModal = modalScope.closeModal;
- }
-
- modalScope.modal.show()
- .then(function () {
- modalScope.$broadcast('modal.afterShow', modalScope.modal);
- });
-
- if (angular.isFunction(options.modalCallback)) {
- options.modalCallback(modal);
- }
-
- }, function (err) {
- deferred.reject(err);
- });
-
- return deferred.promise;
- }
-
- function _cleanup(scope) {
- scope.$destroy();
- if (scope.modal) {
- scope.modal.remove();
- }
- }
-
- function _evalController(ctrlName) {
- var result = {
- isControllerAs: false,
- controllerName: '',
- propName: ''
- };
- var fragments = (ctrlName || '').trim().split(/\s+/);
- result.isControllerAs = fragments.length === 3 && (fragments[1] || '').toLowerCase() === 'as';
- if (result.isControllerAs) {
- result.controllerName = fragments[0];
- result.propName = fragments[2];
- } else {
- result.controllerName = ctrlName;
- }
-
- return result;
- }
-
-}])
//credit: https://github.com/driftyco/ionic/issues/3131
.factory('SecuredPopups', [
@@ -830,30 +682,7 @@ angular.module('zmApp', [
});
- /*ZMDataModel.getReachableConfig()
- .then (function (data)
- {
- ZMDataModel.zmLog ("REACHABILITY SUCCESS " + JSON.stringify(data));
- proceedWithLogin()
- .then (function(success)
- { d.resolve(success); return d.promise;},
- function(error)
- { d.reject(error); return d.promise;});
-
- },
- function (error)
- {
- ZMDataModel.zmLog ("REACHABILITY ERROR " + JSON.stringify(error));
- ZMDataModel.zmLog ("Still trying to proceed with " + ZMDataModel.getLogin().serverName);
-
- proceedWithLogin()
- .then (function(success)
- { d.resolve(success); return d.promise;},
- function(error)
- { d.reject(error); return d.promise;});
-
-
- });*/
+
return d.promise;
@@ -1108,14 +937,7 @@ angular.module('zmApp', [
});
}, false);
- /*window.addEventListener('wheel', function () {
- var scrollView = angular.element(document.body).injector().get('$ionicScrollDelegate').getScrollView();
- if (scrollView) {
- console.log (JSON.stringify(scrollView));
- scrollView.options.wheelDampen = 1;
- console.log ("HERE");
- }
- });*/
+
// This code takes care of trapping the Android back button
// and takes it to the menu.
@@ -1205,135 +1027,108 @@ angular.module('zmApp', [
//---------------------------------------------------------------------
$ionicPlatform.ready(function () {
-
-
+ var pixelRatio = window.devicePixelRatio || 1;
+ $rootScope.devWidth = ((window.innerWidth > 0) ? window.innerWidth : screen.width);
+ $rootScope.devHeight = ((window.innerHeight > 0) ? window.innerHeight : screen.height);
+ // for making sure we canuse $state.go with ng-click
+ // needed for views that use popovers
+ $rootScope.$state = $state;
+ $rootScope.$stateParams = $stateParams;
+
- $ionicNativeTransitions.enable(true, false);
-
- var lang = ZMDataModel.getDefaultLanguage();
- if (lang == undefined)
- {
- ZMDataModel.zmLog ("No language set, switching to en");
- ZMDataModel.setDefaultLanguage("en", false);
- /*
- if(typeof navigator.globalization !== "undefined") {
- navigator.globalization.getPreferredLanguage(function(language) {
- // dont make this permanent
- ZMDataModel.setDefaultLanguage((language.value).split("-")[0], false);
-
- }, null);
- }*/
+ if (window.cordova && window.cordova.plugins.Keyboard) {
+ cordova.plugins.Keyboard.disableScroll(true);
}
- else
- {
- ZMDataModel.zmLog ("Language stored as:"+lang);
- ZMDataModel.setDefaultLanguage(lang, false);
+ if (window.StatusBar) {
+ // org.apache.cordova.statusbar required
+ StatusBar.styleDefault();
}
- ZMDataModel.zmLog(">>>>Language to be used:" + $translate.proposedLanguage());
- moment.locale($translate.proposedLanguage());
-
if (window.cordova) {
$cordovaSplashscreen.hide();
+
+ cordova.getAppVersion(function (version) {
+ appVersion = version;
+ ZMDataModel.zmLog("App Version: " + appVersion);
+ ZMDataModel.setAppVersion(appVersion);
+ });
}
+ $fileLogger.checkFile().then(function (resp) {
+ if (parseInt(resp.size) > zm.logFileMaxSize) {
- $rootScope.platformOS = "desktop";
-
+ $fileLogger.deleteLogfile().then(function () {
+ ZMDataModel.zmLog("Deleting old log file as it exceeds " + zm.logFileMaxSize + " bytes");
+ });
+ }
+ });
+ $fileLogger.setStorageFilename(zm.logFile);
+ $fileLogger.setTimestampFormat('MMM d, y ' + ZMDataModel.getTimeFormat());
+
+
+ $rootScope.platformOS = "desktop";
ZMDataModel.zmLog("Device is ready");
var ld = ZMDataModel.getLogin();
-
if ($ionicPlatform.is('ios'))
$rootScope.platformOS = "ios";
-
-
if ($ionicPlatform.is('android'))
$rootScope.platformOS = "android";
ZMDataModel.zmLog("You are running on " + $rootScope.platformOS);
+ $ionicNativeTransitions.enable(true, false);
+
+
+ var lang = ZMDataModel.getDefaultLanguage();
+
+
+ if (lang == undefined)
+ {
+ ZMDataModel.zmLog ("No language set, switching to en");
+ lang = "en";
+
+
+ }
+ else
+ {
+ ZMDataModel.zmLog ("Language stored as:"+lang);
+
+ }
+
+ // This always returns success - I'm not rejecting
+ ZMDataModel.setDefaultLanguage(lang, false)
+ .then (function(success) {
+ ZMDataModel.zmLog(">>>>Language to be used:" + $translate.proposedLanguage());
+ moment.locale($translate.proposedLanguage());
+ continueRestOfInit();
+
+ });
+
-
- ZMDataModel.init();
- EventServer.init();
- //if ($rootScope.platformOS == "desktop")
- zmCheckUpdates.start();
- // for making sure we canuse $state.go with ng-click
- // needed for views that use popovers
- $rootScope.$state = $state;
- $rootScope.$stateParams = $stateParams;
-
- // var loginData = ZMDataModel.getLogin();
-
-
-
- $fileLogger.checkFile().then(function (resp) {
- if (parseInt(resp.size) > zm.logFileMaxSize) {
-
- $fileLogger.deleteLogfile().then(function () {
- ZMDataModel.zmLog('Logfile deleted');
-
- });
- } else {
- //console.log("Log file size is " + resp.size + " bytes");
- }
-
-
- });
-
-
-
- //fileLogger is an excellent cross platform library
- // that allows you to manage log files without worrying about
- // paths etc.https://github.com/pbakondy/filelogger
- $fileLogger.setStorageFilename(zm.logFile);
- // easier tz reading
- // $fileLogger.setTimestampFormat('medium');
- $fileLogger.setTimestampFormat('MMM d, y ' + ZMDataModel.getTimeFormat());
-
- ZMDataModel.zmLog("Deleting old log file as it exceeds " + zm.logFileMaxSize + " bytes");
-
- if (window.cordova) {
- // getAppVersion is a handy library
- // that lets you extract the app version in config.xml
- // given that you are always changing versions while
- // uploading to app/play stores, this is very useful
- // to keep in sync and use within your app
-
- cordova.getAppVersion(function (version) {
- appVersion = version;
- ZMDataModel.zmLog("App Version: " + appVersion);
- ZMDataModel.setAppVersion(appVersion);
- });
-
+
+ function continueRestOfInit()
+ {
+ ZMDataModel.zmLog("Language file loaded, continuing with rest");
+ ZMDataModel.init();
+ EventServer.init();
+ zmCheckUpdates.start();
+ ZMDataModel.zmLog("Setting up POST LOGIN timer");
+ zmAutoLogin.start();
}
+
- /*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);
- $rootScope.devHeight = ((window.innerHeight > 0) ? window.innerHeight : screen.height);
-
- //console.log("********Computed Dev Width & Height as" + $rootScope.devWidth + "*" +
- // $rootScope.devHeight);
-
- // What I noticed is when I moved the app to the device
- // the montage screens were not redrawn after resuming from background mode
- // Everything was fine if I switched back to the montage screen
- // so as a global hack I'm just reloading the current state if you switch
- // from foreground to background and back
+ //---------------------------------------------------------------------------
+ // resume handler
+ //----------------------------------------------------------------------------
document.addEventListener("resume", function () {
ZMDataModel.zmLog("App is resuming from background");
var forceDelay = ZMDataModel.getLogin().resumeDelay;
@@ -1373,13 +1168,12 @@ angular.module('zmApp', [
}
}, forceDelay);
-
- //$ionicSideMenuDelegate.toggleLeft(false);
- //ZMDataModel.validatePin()
-
}, false);
+ //---------------------------------------------------------------------------
+ // background handler
+ //----------------------------------------------------------------------------
document.addEventListener("pause", function () {
ZMDataModel.setBackground(true);
ZMDataModel.setJustResumed(true); // used for window stop
@@ -1407,36 +1201,12 @@ angular.module('zmApp', [
if ($rootScope.zmPopup)
$rootScope.zmPopup.close();
-
-
-
- //$ionicPopup.close();
-
-
- /* if ($rootScope.platformOS == 'android')
- {
- ZMDataModel.zmLog("Android detected - calling stop");
- window.stop();
- //ionic.Platform.exitApp();
- }*/
}, false);
- if (window.cordova && window.cordova.plugins.Keyboard) {
- //cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
- // solves screen bouncing on form input
- // since I am using JS Scroll
- cordova.plugins.Keyboard.disableScroll(true);
- }
- if (window.StatusBar) {
- // org.apache.cordova.statusbar required
- StatusBar.styleDefault();
- }
+
- // lets POST so we get a session ID right hre
-
- ZMDataModel.zmLog("Setting up POST LOGIN timer");
- zmAutoLogin.start();
+
}); //platformReady