frontend: new parameters to setup kind of notifications allowed
This commit is contained in:
parent
24989c4cfa
commit
ef35879dde
4 changed files with 141 additions and 15 deletions
|
|
@ -40,7 +40,7 @@ angular.module("FICApp", ["ngSanitize", "ngAnimate"])
|
|||
refreshEvents()
|
||||
$interval(refreshEvents, 2100);
|
||||
})
|
||||
.controller("TimerController", function($scope, $rootScope, $interval) {
|
||||
.controller("TimerController", function($scope, $rootScope, $interval, $timeout) {
|
||||
$scope.duration = 0;
|
||||
|
||||
$scope.init = function(end) {
|
||||
|
|
@ -53,9 +53,12 @@ angular.module("FICApp", ["ngSanitize", "ngAnimate"])
|
|||
})
|
||||
}
|
||||
$scope.initT = function(end) {
|
||||
var time = angular.fromJson(sessionStorage.userService);
|
||||
var srv_cur = new Date(Date.now() + (time.cu - time.he));
|
||||
$scope.duration = Math.floor((end - srv_cur)/1000);
|
||||
var time = angular.fromJson(sessionStorage.time);
|
||||
if (time) {
|
||||
var srv_cur = new Date(Date.now() + (time.cu - time.he));
|
||||
$scope.duration = Math.floor((end - srv_cur)/1000);
|
||||
} else
|
||||
$timeout(function() { $scope.initT(end); }, 1000);
|
||||
}
|
||||
|
||||
var stop = $interval(function() {
|
||||
|
|
|
|||
Reference in a new issue