From b36e3f10538aaeb392b6bea4a0fd2f18fd74f81b Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 31 May 2015 13:53:02 +0930 Subject: [PATCH] Simplify active discussion detection --- framework/core/js/forum/src/components/discussion-list.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/framework/core/js/forum/src/components/discussion-list.js b/framework/core/js/forum/src/components/discussion-list.js index 47e755d19..3b8ab3bdb 100644 --- a/framework/core/js/forum/src/components/discussion-list.js +++ b/framework/core/js/forum/src/components/discussion-list.js @@ -127,8 +127,7 @@ export default class DiscussionList extends Component { var controls = discussion.controls(this).toArray(); - var discussionRoute = app.route('discussion', { id: discussion.id(), slug: discussion.slug() }); - var active = m.route().substr(0, discussionRoute.length) === discussionRoute; + var active = m.route.param('id') === discussion.id(); var subtree = this.subtrees[discussion.id()]; return m('li.discussion-summary'+(isUnread ? '.unread' : '')+(active ? '.active' : ''), {