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.

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

YashRE42f21cee7caa1c
diff --git a/frontend_tests/node_tests/upload.js b/frontend_tests/node_tests/upload.js
index 3d6e41a5f36..f3a748265c6 100644
--- a/frontend_tests/node_tests/upload.js
+++ b/frontend_tests/node_tests/upload.js
@@ -105,7 +105,7 @@ test("get_item", () => {
assert.equal(upload.get_item("source", {mode: "edit", row: 123}), "message-edit-file-input");
assert.equal(
upload.get_item("drag_drop_container", {mode: "edit", row: 1}),
- $(".message_edit_form"),
+ $(`#zfilt${CSS.escape(1)} .message_edit_form`),
);
assert.equal(
upload.get_item("markdown_preview_hide_button", {mode: "edit", row: 65}),
diff --git a/static/js/upload.js b/static/js/upload.js
index fe6155bf995..50f5dd9dfc5 100644
--- a/static/js/upload.js
+++ b/static/js/upload.js
@@ -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: