Skip to content

Commit

Permalink
FIX: Reply and new Topic broke with new composer
Browse files Browse the repository at this point in the history
  • Loading branch information
eviltrout committed Nov 9, 2015
1 parent 7d3be0f commit a33c2fa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/assets/javascripts/discourse/controllers/topic.js.es6
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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}`);
});
},

Expand Down

0 comments on commit a33c2fa

Please sign in to comment.