From a33c2fa165a8179943bdc4971601ab42a976e82c Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 9 Nov 2015 12:28:42 -0500 Subject: [PATCH] FIX: Reply and new Topic broke with new composer --- .../javascripts/discourse/controllers/topic.js.es6 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/topic.js.es6 b/app/assets/javascripts/discourse/controllers/topic.js.es6 index 174aee1a4ac..fb9eb92e9e4 100644 --- a/app/assets/javascripts/discourse/controllers/topic.js.es6 +++ b/app/assets/javascripts/discourse/controllers/topic.js.es6 @@ -103,7 +103,7 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, { composerController.get('content.action') === Discourse.Composer.REPLY) { composerController.set('content.post', post); composerController.set('content.composeState', Discourse.Composer.OPEN); - composerController.appendText(quotedText); + this.appEvents.trigger('composer:insert-text', quotedText.trim()); } else { const opts = { @@ -395,9 +395,10 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, { }).then(() => { return Em.isEmpty(quotedText) ? Discourse.Post.loadQuote(post.get('id')) : quotedText; }).then(q => { - const postUrl = `${location.protocol}//${location.host}${post.get('url')}`, - postLink = `[${Handlebars.escapeExpression(self.get('model.title'))}](${postUrl})`; - composerController.appendText(`${I18n.t("post.continue_discussion", { postLink })}\n\n${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}`); }); },