diff options
| -rw-r--r-- | config.xml | 4 | ||||
| -rw-r--r-- | www/js/EventCtrl.js | 38 | ||||
| -rwxr-xr-x | www/js/app.js | 2 |
3 files changed, 36 insertions, 8 deletions
@@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<widget android-packageName="com.pliablepixels.zmninja_pro" id="com.pliablepixels.zmninja_pro" ios-CFBundleIdentifier="com.pliablepixels.zmninja-pro" version="1.3.042" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0"> +<widget android-packageName="com.pliablepixels.zmninja_pro" id="com.pliablepixels.zmninja_pro" ios-CFBundleIdentifier="com.pliablepixels.zmninja-pro" version="1.3.043" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>zmNinja</name> <description> High performance ZoneMinder client @@ -178,5 +178,5 @@ <variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" /> </plugin> <engine name="android" spec="7.1.4" /> - <engine name="ios" spec="~4.5.5" /> + <engine name="ios" spec="4.5.5" /> </widget> diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index b0d61180..5cf91eb3 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -127,13 +127,29 @@ angular.module('zmApp.controllers') }, 100); - /* NVR.debug ("Starting page refresh timer"); + NVR.debug ("Starting page refresh timer"); + $interval.cancel(intervalReloadEvents); intervalReloadEvents = $interval(function () { - doRefresh(); - }.bind(this), 10 * 1000);*/ + timedPageReload(); + }.bind(this), zm.eventPageRefresh); }); + function timedPageReload() { + + + if ($ionicScrollDelegate.$getByHandle("mainScroll").getScrollPosition().top !=0 ) { + NVR.debug ("Not reloading as you have scrolled"); + + } + else if ($scope.modal != undefined && $scope.modal.isShown()) { + NVR.debug ("Not reloading as you have a modal open"); + } + else { + doRefresh(); + } + + } function playSpecificEvent(eid) { NVR.log("Stuffing EID to play back " + eid); @@ -153,8 +169,8 @@ angular.module('zmApp.controllers') $scope.$on('$ionicView.beforeLeave', function () { - /*NVR.debug ("Cancelling page reload timer"); - $interval.cancel(intervalReloadEvents);*/ + NVR.debug ("Cancelling page reload timer"); + $interval.cancel(intervalReloadEvents); NVR.debug("EventCtrl: Deregistering resize listener"); window.removeEventListener("resize", recomputeThumbSize, false); //NVR.debug("EventCtrl: Deregistering broadcast handles"); @@ -171,6 +187,18 @@ angular.module('zmApp.controllers') $scope.mid = ''; + $scope.$on ("alarm", function() { + NVR.debug ("EventCtrl: new event notiication, doing an immediate reload"); + // do an immediate display reload and schedule timer again + $interval.cancel(intervalReloadEvents); + timedPageReload(); + intervalReloadEvents = $interval(function () { + timedPageReload(); + }.bind(this), zm.eventPageRefresh); + + + }); + $scope.$on ( "process-push", function () { NVR.debug (">> EventCtrl: push handler"); var s = NVR.evaluateTappedNotification(); diff --git a/www/js/app.js b/www/js/app.js index 0b377420..ffd456fe 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -83,7 +83,7 @@ angular.module('zmApp', [ nphSwitchTimer: 3000, eventHistoryTimer: 5000, eventPlaybackQuery: 3000, - + eventPageRefresh: 30000, // 30s packeryTimer: 500, dbName: 'zmninja', cipherKey: 'sdf#@#%FSXSA_AR', |
