diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2019-08-07 08:55:33 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2019-08-07 08:55:33 -0400 |
| commit | f63d5c9928ba2c566794712acf065067df9473f2 (patch) | |
| tree | ab4af0149c8e3955d067cfcf76269e6c758c6c3f /www | |
| parent | aa0674f98b8cba1867f9ce2ca9e26a6d748f2c4a (diff) | |
fix analyze window close issue
Diffstat (limited to 'www')
| -rw-r--r-- | www/js/EventCtrl.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 44dc640c..71c973fb 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -2543,7 +2543,9 @@ angular.module('zmApp.controllers') $scope.modalGraph = function () { - $scope.lastVideoStateTime = ''; + $scope.lastVideoStateTime = { + 'time':'' + }; $ionicModal.fromTemplateUrl('templates/events-modalgraph.html', { scope: $scope, // give ModalCtrl access to this scope animation: 'slide-in-up', @@ -2559,6 +2561,9 @@ angular.module('zmApp.controllers') }; $scope.analyzeEvent = function (ev) { + $scope.lastVideoStateTime = { + 'time':'' + }; $scope.event = ev; $ionicModal.fromTemplateUrl('templates/timeline-modal.html', { scope: $scope, // give ModalCtrl access to this scope @@ -2693,11 +2698,14 @@ angular.module('zmApp.controllers') //-------------------------------------------------------- $scope.closeModal = function () { NVR.debug(">>>EventCtrl:Close & Destroy Modal"); - var diff = moment().diff($scope.lastVideoStateTime.time); - if (diff <= 300) { - NVR.debug ("Not closing model, time interval was only:"+diff+" ms"); - return; + if ($scope.lastVideoStateTime && $scope.lastVideoStateTime.time) { + var diff = moment().diff($scope.lastVideoStateTime.time); + if (diff <= 300) { + NVR.debug ("Not closing model, time interval was only:"+diff+" ms"); + return; + } } + NVR.setAwake(false); if ($scope.modal !== undefined) { |
