mirror of
https://github.com/discourse/discourse.git
synced 2025-04-01 13:45:55 +08:00
FIX: Reply As New Topic from all 3 different places
This commit is contained in:
parent
589bae5c03
commit
74e93d2260
@ -33,7 +33,8 @@ export default Ember.Controller.extend({
|
|||||||
replyAsNewTopic() {
|
replyAsNewTopic() {
|
||||||
const topicController = this.get("controllers.topic");
|
const topicController = this.get("controllers.topic");
|
||||||
const postStream = topicController.get("model.postStream");
|
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);
|
topicController.send("replyAsNewTopic", post);
|
||||||
this.send("close");
|
this.send("close");
|
||||||
},
|
},
|
||||||
|
@ -92,7 +92,7 @@ export default Ember.View.extend({
|
|||||||
const $currentTarget = $(e.currentTarget),
|
const $currentTarget = $(e.currentTarget),
|
||||||
url = $currentTarget.data('share-url'),
|
url = $currentTarget.data('share-url'),
|
||||||
postNumber = $currentTarget.data('post-number'),
|
postNumber = $currentTarget.data('post-number'),
|
||||||
postId = $currentTarget.data('post-id'),
|
postId = $currentTarget.closest('article').data('post-id'),
|
||||||
date = $currentTarget.children().data('time');
|
date = $currentTarget.children().data('time');
|
||||||
showPanel($currentTarget, url, postNumber, date, postId);
|
showPanel($currentTarget, url, postNumber, date, postId);
|
||||||
return false;
|
return false;
|
||||||
|
@ -162,7 +162,6 @@ createWidget('post-meta-data', {
|
|||||||
href: attrs.shareUrl,
|
href: attrs.shareUrl,
|
||||||
'data-share-url': attrs.shareUrl,
|
'data-share-url': attrs.shareUrl,
|
||||||
'data-post-number': attrs.post_number,
|
'data-post-number': attrs.post_number,
|
||||||
'data-post-id': attrs.id,
|
|
||||||
}
|
}
|
||||||
}, dateNode(createdAt))
|
}, dateNode(createdAt))
|
||||||
));
|
));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user