activate PDF preview also in server build, fixes #1208

This commit is contained in:
zadam 2020-08-27 23:22:36 +02:00
parent e8d63b5647
commit 26dfa1ffdb
3 changed files with 4 additions and 5 deletions

View file

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

View file

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

View file

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