Skip to content

Build your personal knowledge base with Trilium Notes

activate PDF preview also in server build, fixes #1208

zadam26dfa1ffdb0b
diff --git a/src/public/app/services/note_content_renderer.js b/src/public/app/services/note_content_renderer.js
index 7691f981bc..ba10560362 100644
--- a/src/public/app/services/note_content_renderer.js
+++ b/src/public/app/services/note_content_renderer.js
@@ -92,7 +92,7 @@ async function getRenderedContent(note) {
function getRenderingType(note) {
let type = note.type;
- if (type === 'file' && note.mime === 'application/pdf' && utils.isElectron()) {
+ if (type === 'file' && note.mime === 'application/pdf') {
type = 'pdf';
}
diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js
index 5d78a69047..dac616e932 100644
--- a/src/public/app/widgets/note_tree.js
+++ b/src/public/app/widgets/note_tree.js
@@ -303,13 +303,12 @@ export default class NoteTreeWidget extends TabAwareWidget {
this.$tree.fancytree({
titlesTabbable: true,
- autoScroll: true,
keyboard: false, // we takover keyboard handling in the hotkeys plugin
extensions: utils.isMobile() ? ["dnd5", "clones"] : ["hotkeys", "dnd5", "clones"],
source: treeData,
scrollOfs: {
- top: 200,
- bottom: 200
+ top: 100,
+ bottom: 100
},
scrollParent: this.$tree,
minExpandLevel: 2, // root can't be collapsed
diff --git a/src/public/app/widgets/type_widgets/file.js b/src/public/app/widgets/type_widgets/file.js
index 910ec52642..a4e68a4525 100644
--- a/src/public/app/widgets/type_widgets/file.js
+++ b/src/public/app/widgets/type_widgets/file.js
@@ -124,7 +124,7 @@ export default class FileTypeWidget extends TypeWidget {
this.$previewContent.show().scrollTop(0);
this.$previewContent.text(noteComplement.content);
}
- else if (note.mime === 'application/pdf' && utils.isElectron()) {
+ else if (note.mime === 'application/pdf') {
this.$pdfPreview.show();
this.$pdfPreview.attr("src", utils.getUrlForDownload("api/notes/" + this.noteId + "/open"));
}