compose: Use insert_syntax_and_focus to insert text in compose textarea.

Use compose_ui.insert_syntax_and_focus() when we need to insert text
inline-ly followed by the focus to compose textarea because it does
this job more smartly(it take cares of spaces).
This commit is contained in:
Shubham Dhama
2018-02-26 20:34:40 +05:30
committed by Tim Abbott
parent c995c1a36a
commit dcac002213
3 changed files with 9 additions and 6 deletions

View File

@@ -320,7 +320,7 @@ exports.reply_with_mention = function (opts) {
exports.respond_to_message(opts);
var message = current_msg_list.selected_message();
var mention = '@**' + message.sender_full_name + '**';
$('#compose-textarea').val(mention + ' ');
compose_ui.insert_syntax_and_focus(mention);
};
exports.on_topic_narrow = function () {