upload: Return single elem for get_item(drag_drop_container) w/ edit.

Previously, opening multiple message_edits and then drag-dropping a
file into any one of them would cause all of them to upload ie you'd
get one uploaded file in each message_edit.

This bug was caused by returning multiple elements from
upload.get_item("drag_drop_container", config) when config.mode =
"edit".

This commit changes the selector to use the row provided (config.row),
and so ensures that the above bug doesn't happen.
This commit is contained in:
YashRE42
2021-10-29 17:29:36 +05:30
committed by Tim Abbott
parent e8eb6724ad
commit f21cee7caa
2 changed files with 2 additions and 2 deletions

View File

@@ -77,7 +77,7 @@ export function get_item(key, config) {
case "source":
return "message-edit-file-input";
case "drag_drop_container":
return $(".message_edit_form");
return $(`#zfilt${CSS.escape(config.row)} .message_edit_form`);
case "markdown_preview_hide_button":
return $(`#edit_form_${CSS.escape(config.row)} .undo_markdown_preview`);
default: