summaryrefslogtreecommitdiff
path: root/www/js/MonitorCtrl.js
diff options
context:
space:
mode:
authorArjun Roychowdhury <pliablepixels@gmail.com>2015-10-08 14:13:40 -0400
committerArjun Roychowdhury <pliablepixels@gmail.com>2015-10-08 14:13:40 -0400
commitac992d9d8be5dd71e60c5650efe84c3f40a36e6e (patch)
treeb2acdabc5c773a61dffb8425e3c789e79b06d1bd /www/js/MonitorCtrl.js
parenta5e032c1d38152644ffabead6536dd14b0433119 (diff)
badge notification count for events
Diffstat (limited to 'www/js/MonitorCtrl.js')
-rw-r--r--www/js/MonitorCtrl.js19
1 files changed, 17 insertions, 2 deletions
diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js
index 68ae0438..da73d52b 100644
--- a/www/js/MonitorCtrl.js
+++ b/www/js/MonitorCtrl.js
@@ -6,8 +6,8 @@
// refer to comments in EventCtrl for the modal stuff. They are almost the same
angular.module('zmApp.controllers')
- .controller('zmApp.MonitorCtrl', ['$ionicPopup', 'zm', '$scope', 'ZMDataModel', 'message', '$ionicSideMenuDelegate', '$ionicLoading', '$ionicModal', '$state', '$http', '$rootScope',
- function ($ionicPopup, zm, $scope, ZMDataModel, message, $ionicSideMenuDelegate, $ionicLoading, $ionicModal, $state, $http, $rootScope, $timeout) {
+ .controller('zmApp.MonitorCtrl', ['$ionicPopup', 'zm', '$scope', 'ZMDataModel', 'message', '$ionicSideMenuDelegate', '$ionicLoading', '$ionicModal', '$state', '$http', '$rootScope', '$timeout','$ionicHistory',
+ function ($ionicPopup, zm, $scope, ZMDataModel, message, $ionicSideMenuDelegate, $ionicLoading, $ionicModal, $state, $http, $rootScope, $timeout, $ionicHistory) {
//-----------------------------------------------------------------------
@@ -32,6 +32,21 @@ angular.module('zmApp.controllers')
};
+ //----------------------------------------------------------------
+ // Alarm notification handling
+ //----------------------------------------------------------------
+ $scope.handleAlarms = function()
+ {
+ $rootScope.isAlarm=!$rootScope.isAlarm;
+ if (!$rootScope.isAlarm)
+ {
+ $rootScope.alarmCount="0";
+ $ionicHistory.nextViewOptions({disableBack: true});
+
+
+ $state.go("events", {"id": 0}, { reload: true });
+ }
+ };
//-----------------------------------------------------------------------
// This function takes care of changing monitor parameters
// For now, I've only limited it to enable/disable and change monitor mode