From 8a6f8436046d0bb99ac305972682733f150a0db8 Mon Sep 17 00:00:00 2001 From: Athou Date: Fri, 22 Mar 2013 23:54:52 +0100 Subject: [PATCH] don't refresh menu when changing categories --- .../frontend/pages/home/HomePage.html | 19 ++++++- src/main/webapp/js/controllers.js | 10 +++- src/main/webapp/templates/feeds.html | 49 ++++++------------- 3 files changed, 42 insertions(+), 36 deletions(-) diff --git a/src/main/java/com/commafeed/frontend/pages/home/HomePage.html b/src/main/java/com/commafeed/frontend/pages/home/HomePage.html index 09c380ac..ee05d822 100644 --- a/src/main/java/com/commafeed/frontend/pages/home/HomePage.html +++ b/src/main/java/com/commafeed/frontend/pages/home/HomePage.html @@ -9,7 +9,24 @@
- +
+
+
+
+
    + +
+
+
+
+ +
+
+
diff --git a/src/main/webapp/js/controllers.js b/src/main/webapp/js/controllers.js index 6078caf0..041563b8 100644 --- a/src/main/webapp/js/controllers.js +++ b/src/main/webapp/js/controllers.js @@ -9,8 +9,10 @@ module.run(function($rootScope) { module.controller('CategoryTreeCtrl', function($scope, $routeParams, $location, CategoryService) { - $scope.selectedType = $routeParams._type; - $scope.selectedId = $routeParams._id; + $scope.$on('$routeChangeSuccess', function() { + $scope.selectedType = $routeParams._type; + $scope.selectedId = $routeParams._id; + }); $scope.root = CategoryService.get(); @@ -48,10 +50,14 @@ module.controller('CategoryTreeCtrl', function($scope, $routeParams, $location, } $scope.feedClicked = function(id) { + $scope.selectedType = 'feed'; + $scope.selectedId = id; $location.path('/feeds/view/feed/' + id); }; $scope.categoryClicked = function(id) { + $scope.selectedType = 'category'; + $scope.selectedId = id; $location.path('/feeds/view/category/' + id); }; diff --git a/src/main/webapp/templates/feeds.html b/src/main/webapp/templates/feeds.html index 642dca4a..c48b458a 100644 --- a/src/main/webapp/templates/feeds.html +++ b/src/main/webapp/templates/feeds.html @@ -1,37 +1,20 @@ -
-
-
-
-
    - -
+
+ {{entryList.name}} » +
\ No newline at end of file