mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-10-18 20:56:18 +08:00
fix(client/file): flicker when too big alert is not needed
This commit is contained in:
parent
61f2e35717
commit
6b5d905ebe
@ -31,7 +31,7 @@ const TPL = `
|
|||||||
}
|
}
|
||||||
</style>
|
</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 })}
|
${t("file.too_big", { maxNumChars: TEXT_MAX_NUM_CHARS })}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ export default class FileTypeWidget extends TypeWidget {
|
|||||||
this.$previewContent.empty().hide();
|
this.$previewContent.empty().hide();
|
||||||
this.$pdfPreview.attr("src", "").empty().hide();
|
this.$pdfPreview.attr("src", "").empty().hide();
|
||||||
this.$previewNotAvailable.hide();
|
this.$previewNotAvailable.hide();
|
||||||
this.$previewTooBig.hide();
|
this.$previewTooBig.addClass("hidden-ext");
|
||||||
this.$videoPreview.hide();
|
this.$videoPreview.hide();
|
||||||
this.$audioPreview.hide();
|
this.$audioPreview.hide();
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ export default class FileTypeWidget extends TypeWidget {
|
|||||||
this.$previewContent.show().scrollTop(0);
|
this.$previewContent.show().scrollTop(0);
|
||||||
const trimmedContent = blob.content.substring(0, TEXT_MAX_NUM_CHARS);
|
const trimmedContent = blob.content.substring(0, TEXT_MAX_NUM_CHARS);
|
||||||
if (trimmedContent.length !== blob.content.length) {
|
if (trimmedContent.length !== blob.content.length) {
|
||||||
this.$previewTooBig.show();
|
this.$previewTooBig.removeClass("hidden-ext");
|
||||||
}
|
}
|
||||||
this.$previewContent.text(trimmedContent);
|
this.$previewContent.text(trimmedContent);
|
||||||
} else if (note.mime === "application/pdf") {
|
} else if (note.mime === "application/pdf") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user