FIX: Reply As New Topic from all 3 different places

This commit is contained in:
Régis Hanol 2016-06-26 14:20:22 +02:00
parent 589bae5c03
commit 74e93d2260
3 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,8 @@ export default Ember.Controller.extend({
replyAsNewTopic() {
const topicController = this.get("controllers.topic");
const postStream = topicController.get("model.postStream");
const post = postStream.findLoadedPost(this.get("postId"));
const postId = this.get("postId") || postStream.findPostIdForPostNumber(1);
const post = postStream.findLoadedPost(postId);
topicController.send("replyAsNewTopic", post);
this.send("close");
},

View File

@ -92,7 +92,7 @@ export default Ember.View.extend({
const $currentTarget = $(e.currentTarget),
url = $currentTarget.data('share-url'),
postNumber = $currentTarget.data('post-number'),
postId = $currentTarget.data('post-id'),
postId = $currentTarget.closest('article').data('post-id'),
date = $currentTarget.children().data('time');
showPanel($currentTarget, url, postNumber, date, postId);
return false;

View File

@ -162,7 +162,6 @@ createWidget('post-meta-data', {
href: attrs.shareUrl,
'data-share-url': attrs.shareUrl,
'data-post-number': attrs.post_number,
'data-post-id': attrs.id,
}
}, dateNode(createdAt))
));