From 831893647be2b4bc0e118148ac23c1144c83de0b Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Thu, 26 Jun 2014 12:22:27 +0200 Subject: fix js unit tests --- js/build/app.js | 6 ++++-- js/controller/NavigationController.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/build/app.js b/js/build/app.js index d3e5934b3..a3a749132 100644 --- a/js/build/app.js +++ b/js/build/app.js @@ -375,10 +375,12 @@ var $__build_47_app__ = function () { return $route.current && $route.current.$$route.type === FEED_TYPE.STARRED; }; this.isFolderActive = function (folderId) { - return $route.current && $route.current.$$route.type === FEED_TYPE.FOLDER && $route.current.params.id === folderId + ''; + var currentId = parseInt($route.current.params.id, 10); + return $route.current && $route.current.$$route.type === FEED_TYPE.FOLDER && currentId === folderId; }; this.isFeedActive = function (feedId) { - return $route.current && $route.current.$$route.type === FEED_TYPE.FEED && $route.current.params.id === feedId + ''; + var currentId = parseInt($route.current.params.id, 10); + return $route.current && $route.current.$$route.type === FEED_TYPE.FEED && currentId === feedId; }; this.isAddingFolder = function () { return true; diff --git a/js/controller/NavigationController.js b/js/controller/NavigationController.js index 25fa6ddd1..a848a4b39 100644 --- a/js/controller/NavigationController.js +++ b/js/controller/NavigationController.js @@ -98,15 +98,17 @@ function ($route, FEED_TYPE, FeedResource, FolderResource, ItemResource, }; this.isFolderActive = (folderId) => { + let currentId = parseInt($route.current.params.id, 10); return $route.current && $route.current.$$route.type === FEED_TYPE.FOLDER && - $route.current.params.id === folderId + ''; + currentId === folderId; }; this.isFeedActive = (feedId) => { + let currentId = parseInt($route.current.params.id, 10); return $route.current && $route.current.$$route.type === FEED_TYPE.FEED && - $route.current.params.id === feedId + ''; + currentId === feedId; }; // TBD -- cgit v1.2.3