From faa475adccb2113e34ba06d9ee0f2ca49dcdef53 Mon Sep 17 00:00:00 2001 From: Athou Date: Sun, 24 Mar 2013 17:27:01 +0100 Subject: [PATCH] reload route if clicked on the same tree node --- src/main/webapp/js/controllers.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/js/controllers.js b/src/main/webapp/js/controllers.js index eac95601..64873756 100644 --- a/src/main/webapp/js/controllers.js +++ b/src/main/webapp/js/controllers.js @@ -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) {