compose: Use class to find markdown_preview related elements.

We convert the following elements to use a class instead of
id for accessing them across the codebase:

* markdown_preview
* undo_markdown_preview
* markdown_preview_spinner
* message_edit_content
* preview_content

Converted them together since changes to one impacted the other in
some modules like click_handlers.

Also, added a function in rows to get `message_row`.
This commit is contained in:
Aman Agrawal
2021-04-20 17:50:01 +00:00
committed by Tim Abbott
parent 8ebced2791
commit 84a7f08acc
17 changed files with 120 additions and 114 deletions

View File

@@ -686,7 +686,9 @@ export function register_click_handlers() {
// The following check will return false if emoji was not selected in
// message edit form.
if (edit_message_id !== null) {
const edit_message_textarea = $(`#message_edit_content_${CSS.escape(edit_message_id)}`);
const edit_message_textarea = $(
`#edit_form_${CSS.escape(edit_message_id)} .message_edit_content`,
);
// Assign null to edit_message_id so that the selection of emoji in new
// message composition form works correctly.
edit_message_id = null;