mirror of
https://github.com/zadam/trilium.git
synced 2024-11-11 01:23:57 +08:00
activate PDF preview also in server build, fixes #1208
This commit is contained in:
parent
e8d63b5647
commit
26dfa1ffdb
3 changed files with 4 additions and 5 deletions
|
@ -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';
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue