compose: Use a placeholder when quoting and replying.

Use the placeholder `[Quoting…]` when quoting and replying before the
quote has been added to the message. Also, add tests to the
`compose_actions` Node tests for the new behavior.

Fix #10705.
This commit is contained in:
Marco Burstein
2018-11-01 15:43:29 -07:00
committed by Tim Abbott
parent f9d867e138
commit 207d7a8ee6
2 changed files with 44 additions and 5 deletions

View File

@@ -390,15 +390,13 @@ exports.quote_and_reply = function (opts) {
var message_id = current_msg_list.selected_id();
exports.respond_to_message(opts);
compose_ui.insert_syntax_and_focus("[Quoting…]\n", textarea);
channel.get({
url: '/json/messages/' + message_id,
idempotent: true,
success: function (data) {
if (textarea.val() === "") {
textarea.val("```quote\n" + data.raw_content + "\n```\n");
} else {
textarea.val(textarea.val() + "\n```quote\n" + data.raw_content + "\n```\n");
}
compose_ui.replace_syntax('[Quoting…]', '```quote\n' + data.raw_content + '\n```', textarea);
$("#compose-textarea").trigger("autosize.resize");
},
});