FIX: prepend 'continue discussion' link to topic template
This commit is contained in:
@@ -509,7 +509,7 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
|
||||
}).then(q => {
|
||||
const postUrl = `${location.protocol}//${location.host}${post.get('url')}`;
|
||||
const postLink = `[${Handlebars.escapeExpression(self.get('model.title'))}](${postUrl})`;
|
||||
composerController.get('model').appendText(`${I18n.t("post.continue_discussion", { postLink })}\n\n${q}`);
|
||||
composerController.get('model').prependText(`${I18n.t("post.continue_discussion", { postLink })}\n\n${q}`, {new_line: true});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@@ -360,6 +360,15 @@ const Composer = RestModel.extend({
|
||||
return before.length + text.length;
|
||||
},
|
||||
|
||||
prependText(text, opts) {
|
||||
const reply = (this.get('reply') || '');
|
||||
|
||||
if (opts && opts.new_line && reply.length > 0) {
|
||||
text = text.trim() + "\n\n";
|
||||
}
|
||||
this.set('reply', text + reply);
|
||||
},
|
||||
|
||||
applyTopicTemplate(oldCategoryId, categoryId) {
|
||||
if (this.get('action') !== CREATE_TOPIC) { return; }
|
||||
let reply = this.get('reply');
|
||||
|
||||
Reference in New Issue
Block a user