fix autorefresh
This commit is contained in:
parent
ed6c96cbae
commit
ad88ed54d5
|
@ -24,7 +24,6 @@ angular.module('ffhb', [
|
||||||
};
|
};
|
||||||
amMoment.changeLocale('de');
|
amMoment.changeLocale('de');
|
||||||
$rootScope.globals = $cookieStore.get('globals') || {};
|
$rootScope.globals = $cookieStore.get('globals') || {};
|
||||||
$rootScope.autorefresh = config.refresh;
|
|
||||||
if ($rootScope.globals.currentUser) {
|
if ($rootScope.globals.currentUser) {
|
||||||
$http.defaults.headers.common['Authorization'] = 'Basic ' + $rootScope.globals.currentUser.authdata; // jshint ignore:line
|
$http.defaults.headers.common['Authorization'] = 'Basic ' + $rootScope.globals.currentUser.authdata; // jshint ignore:line
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ angular.module('ffhb')
|
||||||
};
|
};
|
||||||
myservice.autorefresh = function(time){
|
myservice.autorefresh = function(time){
|
||||||
if(autorefresher !== undefined){
|
if(autorefresher !== undefined){
|
||||||
autorefresher.cancel();
|
$interval.cancel(autorefresher);
|
||||||
}
|
}
|
||||||
if(time){
|
if(time){
|
||||||
autorefresher = $interval(function () {
|
autorefresher = $interval(function () {
|
||||||
|
@ -150,7 +150,8 @@ angular.module('ffhb')
|
||||||
}, time);
|
}, time);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
$rootScope.autorefresh = config.refresh;
|
||||||
|
myservice.autorefresh($rootScope.autorefresh);
|
||||||
|
|
||||||
return myservice;
|
return myservice;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue