Fix #4230: Inconsistency between DText preview and DText renders of inline DText.

This commit is contained in:
evazion
2019-12-28 13:26:33 -06:00
parent bb4be383b9
commit 27c797f5c6
4 changed files with 15 additions and 18 deletions

View File

@@ -21,20 +21,14 @@ Dtext.initialize_expandables = function() {
});
}
Dtext.call_preview = function(e, $button, $input, $preview) {
Dtext.call_preview = async function(e, $button, $input, $preview) {
$button.val("Edit");
$input.hide();
$preview.text("Loading...").fadeIn("fast");
$.ajax({
type: "post",
url: "/dtext_preview",
data: {
body: $input.val()
},
success: function(data) {
$preview.html(data).fadeIn("fast");
}
});
let inline = $input.is("input");
let html = await $.post("/dtext_preview", { body: $input.val(), inline: inline });
$preview.html(html).fadeIn("fast");
}
Dtext.call_edit = function(e, $button, $input, $preview) {