Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

markdown: Improve drafts rendering of custom Markdown features.

m-e-l-u-h-a-n16687d4c74c6
diff --git a/static/js/drafts.js b/static/js/drafts.js
index 2c02bce4b2f..6ace0068e9d 100644
--- a/static/js/drafts.js
+++ b/static/js/drafts.js
@@ -22,6 +22,7 @@ import * as markdown from "./markdown";
import * as narrow from "./narrow";
import * as overlays from "./overlays";
import * as people from "./people";
+import * as rendered_markdown from "./rendered_markdown";
import * as stream_data from "./stream_data";
import * as sub_store from "./sub_store";
import * as timerender from "./timerender";
@@ -406,9 +407,17 @@ export function launch() {
drafts,
draft_lifetime: DRAFT_LIFETIME,
});
- $("#drafts_table").append(rendered);
+ const drafts_table = $("#drafts_table");
+ drafts_table.append(rendered);
if ($("#drafts_table .draft-row").length > 0) {
$("#drafts_table .no-drafts").hide();
+ // Update possible dynamic elements.
+ const rendered_drafts = drafts_table.find(
+ ".message_content.rendered_markdown.restore-draft",
+ );
+ rendered_drafts.each(function () {
+ rendered_markdown.update_elements($(this));
+ });
}
}