diff options
| author | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-10-08 14:13:40 -0400 |
|---|---|---|
| committer | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-10-08 14:13:40 -0400 |
| commit | ac992d9d8be5dd71e60c5650efe84c3f40a36e6e (patch) | |
| tree | b2acdabc5c773a61dffb8425e3c789e79b06d1bd /www/js/EventServer.js | |
| parent | a5e032c1d38152644ffabead6536dd14b0433119 (diff) | |
badge notification count for events
Diffstat (limited to 'www/js/EventServer.js')
| -rw-r--r-- | www/js/EventServer.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/www/js/EventServer.js b/www/js/EventServer.js index f0d596a6..ad728661 100644 --- a/www/js/EventServer.js +++ b/www/js/EventServer.js @@ -17,6 +17,9 @@ angular.module('zmApp.controllers') function init() { + $rootScope.isAlarm = 0; + $rootScope.alarmCount="0"; + var loginData = ZMDataModel.getLogin(); if (loginData.eventServer) { @@ -68,8 +71,21 @@ angular.module('zmApp.controllers') } // lets stack the display so they don't overwrite if (eventsToDisplay.length > 0) + { ZMDataModel.displayBanner('alarm', eventsToDisplay, 5000, 5000*eventsToDisplay.length); - $rootScope.isAlarm = 1; + + } + $rootScope.isAlarm = 1; + + if ($rootScope.alarmCount == "99") + { + $rootScope.alarmCount="99+"; + } + if ($rootScope.alarmCount != "99+") + { + $rootScope.alarmCount = (parseInt($rootScope.alarmCount)+1).toString(); + } + } |
