image_upload_widget: Refactor style of upload_widget's preview_image.

Forms using upload widget were using the
same css for image preview.

We fix this by assigning a class to the
widget and applying specific styles to it.
This commit is contained in:
Sahil Singh 2023-03-03 23:17:38 +05:30 committed by Tim Abbott
parent edfb2a3948
commit 89733670fd
3 changed files with 6 additions and 5 deletions

View File

@ -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();
}
}

View File

@ -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;
}

View File

@ -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;
}