From ee931e9f7690cf3aab537b31239b36f7c67d7671 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 24 Feb 2016 14:50:14 +1100 Subject: [PATCH] FIX: link to topic when clicking on up arrow --- app/assets/javascripts/discourse/lib/transform-post.js.es6 | 1 + app/assets/javascripts/discourse/widgets/post-cooked.js.es6 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/transform-post.js.es6 b/app/assets/javascripts/discourse/lib/transform-post.js.es6 index 5eed4be23b8..c65bdf21bb2 100644 --- a/app/assets/javascripts/discourse/lib/transform-post.js.es6 +++ b/app/assets/javascripts/discourse/lib/transform-post.js.es6 @@ -85,6 +85,7 @@ export default function transformPost(currentUser, site, post, prevPost, nextPos const postAtts = transformBasicPost(post); + postAtts.topic = topic; postAtts.topicId = topic.id; postAtts.topicOwner = details.created_by.id === post.user_id; postAtts.post_type = postType; diff --git a/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 b/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 index 1847ca4710e..b8d5cd06f95 100644 --- a/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 @@ -145,7 +145,7 @@ export default class PostCooked { } _urlForPostNumber(postNumber) { - return (postNumber > 0) ? `${this.topicUrl}/${postNumber}` : this.topicUrl; + return (postNumber > 0) ? `${this.attrs.topic.get('url')}/${postNumber}` : this.attrs.topic.get('url'); } _updateQuoteElements($aside, desc) {