diff --git a/web/src/upload_widget.ts b/web/src/upload_widget.ts index f416173d4f..9e881a9e17 100644 --- a/web/src/upload_widget.ts +++ b/web/src/upload_widget.ts @@ -35,6 +35,7 @@ export function build_widget( if ($preview_text !== undefined && $preview_image !== undefined) { const image_blob = URL.createObjectURL(file); $preview_image.attr("src", image_blob); + $preview_image.addClass("upload_widget_image_preview"); $preview_text.show(); } } diff --git a/web/styles/image_upload_widget.css b/web/styles/image_upload_widget.css index 2628bdfbed..3a75d37826 100644 --- a/web/styles/image_upload_widget.css +++ b/web/styles/image_upload_widget.css @@ -206,3 +206,8 @@ justify-content: space-around; flex-wrap: wrap; } + +/* CSS related to upload widget's preview image */ +.upload_widget_image_preview { + object-fit: cover; +} diff --git a/web/styles/settings.css b/web/styles/settings.css index 233577c54a..7103285f7a 100644 --- a/web/styles/settings.css +++ b/web/styles/settings.css @@ -671,10 +671,6 @@ input[type="checkbox"] { #emoji_preview_text { margin-top: 6px; } - - #emoji_preview_image { - object-fit: cover; - } } #emoji_file_input_error { @@ -889,7 +885,6 @@ input[type="checkbox"] { .edit_bot_avatar_preview_image, #add_bot_preview_image { height: 100px; - object-fit: cover; width: 100px; margin: 2px 0 8px; }