diff --git a/web/src/upload.js b/web/src/upload.js index 1c5370dc77..310efe231f 100644 --- a/web/src/upload.js +++ b/web/src/upload.js @@ -46,7 +46,7 @@ export function get_item(key, config, file_id) { file_id, )} .upload_banner_cancel_button`, ); - case "upload_banner_close_button": + case "upload_banner_hide_button": return $( `#compose_banners .upload_banner.file_${CSS.escape( file_id, @@ -94,7 +94,7 @@ export function get_item(key, config, file_id) { file_id, )} .upload_banner_cancel_button`, ); - case "upload_banner_close_button": + case "upload_banner_hide_button": return $( `#edit_form_${CSS.escape(config.row)} .upload_banner.file_${CSS.escape( file_id, @@ -232,7 +232,7 @@ export async function upload_files(uppy, config, files) { uppy.removeFile(file.id); hide_upload_banner(uppy, config, file.id); }); - get_item("upload_banner_close_button", config, file.id).one("click", () => { + get_item("upload_banner_hide_button", config, file.id).one("click", () => { hide_upload_banner(uppy, config, file.id); }); } diff --git a/web/tests/upload.test.js b/web/tests/upload.test.js index f5181ca954..11e6abd947 100644 --- a/web/tests/upload.test.js +++ b/web/tests/upload.test.js @@ -54,7 +54,7 @@ test("get_item", () => { $("#compose_banners .upload_banner.file_id_2 .upload_banner_cancel_button"), ); assert.equal( - upload.get_item("upload_banner_close_button", {mode: "compose"}, "id_2"), + upload.get_item("upload_banner_hide_button", {mode: "compose"}, "id_2"), $("#compose_banners .upload_banner.file_id_2 .main-view-banner-close-button"), ); assert.equal( @@ -102,7 +102,7 @@ test("get_item", () => { $(".main-view-banner-close-button"), ); assert.equal( - upload.get_item("upload_banner_close_button", {mode: "edit", row: 2}, "id_34"), + upload.get_item("upload_banner_hide_button", {mode: "edit", row: 2}, "id_34"), $(`#edit_form_${CSS.escape(2)} .upload_banner.file_id_34 .main-view-banner-close-button`), );