mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 23:42:44 +08:00
FEATURE: streamline 'Reply as linked Topic' feature
This commit is contained in:
parent
fcf08f3ed5
commit
3251bcb405
|
@ -428,16 +428,11 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
|
|||
draftKey: Composer.REPLY_AS_NEW_TOPIC_KEY,
|
||||
categoryId: this.get('category.id')
|
||||
}).then(() => {
|
||||
if (Em.isEmpty(quotedText)) {
|
||||
return Discourse.Post.loadQuote(post.get('id'));
|
||||
} else {
|
||||
composerController.get('model').appendText(quotedText);
|
||||
}
|
||||
return Em.isEmpty(quotedText) ? "" : quotedText;
|
||||
}).then(q => {
|
||||
const postUrl = `${location.protocol}//${location.host}${post.get('url')}`;
|
||||
const postLink = `[${Handlebars.escapeExpression(self.get('model.title'))}](${postUrl})`;
|
||||
|
||||
this.appEvents.trigger('composer:insert-text', `${I18n.t("post.continue_discussion", { postLink })}\n\n${q}`);
|
||||
composerController.get('model').appendText(`${I18n.t("post.continue_discussion", { postLink })}\n\n${q}`);
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user