mirror of
https://github.com/zadam/trilium.git
synced 2025-10-26 07:46:30 +01:00
fix(client/file): flicker when too big alert is not needed
This commit is contained in:
@@ -31,7 +31,7 @@ const TPL = `
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="file-preview-too-big alert alert-info">
|
||||
<div class="file-preview-too-big alert alert-info hidden-ext">
|
||||
${t("file.too_big", { maxNumChars: TEXT_MAX_NUM_CHARS })}
|
||||
</div>
|
||||
|
||||
@@ -81,7 +81,7 @@ export default class FileTypeWidget extends TypeWidget {
|
||||
this.$previewContent.empty().hide();
|
||||
this.$pdfPreview.attr("src", "").empty().hide();
|
||||
this.$previewNotAvailable.hide();
|
||||
this.$previewTooBig.hide();
|
||||
this.$previewTooBig.addClass("hidden-ext");
|
||||
this.$videoPreview.hide();
|
||||
this.$audioPreview.hide();
|
||||
|
||||
@@ -89,7 +89,7 @@ export default class FileTypeWidget extends TypeWidget {
|
||||
this.$previewContent.show().scrollTop(0);
|
||||
const trimmedContent = blob.content.substring(0, TEXT_MAX_NUM_CHARS);
|
||||
if (trimmedContent.length !== blob.content.length) {
|
||||
this.$previewTooBig.show();
|
||||
this.$previewTooBig.removeClass("hidden-ext");
|
||||
}
|
||||
this.$previewContent.text(trimmedContent);
|
||||
} else if (note.mime === "application/pdf") {
|
||||
|
||||
Reference in New Issue
Block a user