reload route if clicked on the same tree node

This commit is contained in:
Athou
2013-03-24 17:27:01 +01:00
parent 842c7faea4
commit faa475adcc

View File

@@ -7,7 +7,7 @@ module.run(function($rootScope) {
});
});
module.controller('CategoryTreeCtrl', function($scope, $routeParams, $location,
module.controller('CategoryTreeCtrl', function($scope, $routeParams, $location, $route,
SubscriptionService) {
$scope.$on('$routeChangeSuccess', function() {
@@ -51,11 +51,19 @@ module.controller('CategoryTreeCtrl', function($scope, $routeParams, $location,
}
$scope.feedClicked = function(id) {
$location.path('/feeds/view/feed/' + id);
if($scope.selectedType == 'feed' && id == $scope.selectedId) {
$route.reload();
} else {
$location.path('/feeds/view/feed/' + id);
}
};
$scope.categoryClicked = function(id) {
$location.path('/feeds/view/category/' + id);
if($scope.selectedType == 'category' && id == $scope.selectedId) {
$route.reload();
} else {
$location.path('/feeds/view/category/' + id);
}
};
var mark = function(node, entry) {