forked from Archives/Athou_commafeed
merge new infos into existing array instead of replacing the array completely, prevents full tree refresh and scrollbar location loss (fix #342)
This commit is contained in:
@@ -138,7 +138,7 @@ function($scope, $timeout, $stateParams, $window, $location, $state, $route, Cat
|
|||||||
|
|
||||||
$timeout(function refreshTree() {
|
$timeout(function refreshTree() {
|
||||||
AnalyticsService.track();
|
AnalyticsService.track();
|
||||||
CategoryService.init(function() {
|
CategoryService.refresh(function() {
|
||||||
$timeout(refreshTree, 30000);
|
$timeout(refreshTree, 30000);
|
||||||
}, function() {
|
}, function() {
|
||||||
$timeout(refreshTree, 30000);
|
$timeout(refreshTree, 30000);
|
||||||
@@ -746,7 +746,7 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer
|
|||||||
olderThan : olderThan || $scope.timestamp,
|
olderThan : olderThan || $scope.timestamp,
|
||||||
read : true
|
read : true
|
||||||
}, function() {
|
}, function() {
|
||||||
CategoryService.init(function() {
|
CategoryService.refresh(function() {
|
||||||
$scope.$emit('emitReload');
|
$scope.$emit('emitReload');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -208,6 +208,13 @@ function($resource, $http) {
|
|||||||
callback(data);
|
callback(data);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
res.refresh = function(callback) {
|
||||||
|
res.get(function(data) {
|
||||||
|
_.merge(res.subscriptions, data);
|
||||||
|
if (callback)
|
||||||
|
callback(data);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
res.init();
|
res.init();
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
Reference in New Issue
Block a user