From 048c7e2a4e17aab04a64298b30d6e0776bc8f60a Mon Sep 17 00:00:00 2001 From: Athou Date: Wed, 1 May 2013 07:30:36 +0200 Subject: [PATCH] hide some form elements for meta categories details --- src/main/webapp/js/controllers.js | 13 ++++++++++++- .../webapp/templates/feeds.category_details.html | 8 ++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/js/controllers.js b/src/main/webapp/js/controllers.js index 74f9dad4..706e6626 100644 --- a/src/main/webapp/js/controllers.js +++ b/src/main/webapp/js/controllers.js @@ -236,7 +236,18 @@ module.controller('CategoryDetailsCtrl', ['$scope', '$state', '$stateParams', 'F function($scope, $state, $stateParams, FeedService, CategoryService, $dialog) { $scope.CategoryService = CategoryService; + $scope.isMeta = function() { + return parseInt($stateParams._id, 10) != $stateParams._id; + }; + CategoryService.get(function() { + if ($scope.isMeta()) { + $scope.category = { + id : $stateParams._id, + name : $stateParams._id, + }; + return; + } for (var i = 0; i < CategoryService.flatCategories.length; i++) { var cat = CategoryService.flatCategories[i]; if (cat.id == $stateParams._id) { @@ -244,7 +255,7 @@ module.controller('CategoryDetailsCtrl', ['$scope', '$state', '$stateParams', 'F id: cat.id, name: cat.orig.name, parentId: cat.orig.parentId - } + }; break; } } diff --git a/src/main/webapp/templates/feeds.category_details.html b/src/main/webapp/templates/feeds.category_details.html index 00eef826..ad637882 100644 --- a/src/main/webapp/templates/feeds.category_details.html +++ b/src/main/webapp/templates/feeds.category_details.html @@ -3,7 +3,7 @@

Category details

-
+
@@ -11,7 +11,7 @@
-
+