mirror of
https://github.com/zadam/trilium.git
synced 2024-11-11 01:23:57 +08:00
pdf preview is now also available in include note, book etc.
This commit is contained in:
parent
6a1bfdeab9
commit
a5764c269f
1 changed files with 10 additions and 1 deletions
|
@ -45,7 +45,16 @@ async function getRenderedContent(note) {
|
|||
// open doesn't work for protected notes since it works through browser which isn't in protected session
|
||||
$openButton.toggle(!note.isProtected);
|
||||
|
||||
$rendered = $('<div>')
|
||||
$rendered = $('<div>');
|
||||
|
||||
if (note.mime === 'application/pdf' && utils.isElectron()) {
|
||||
const $pdfPreview = $('<iframe class="pdf-preview" style="width: 100%; height: 100%; flex-grow: 100;"></iframe>');
|
||||
$pdfPreview.attr("src", utils.getUrlForDownload("api/notes/" + note.noteId + "/open"));
|
||||
|
||||
$rendered.append($pdfPreview);
|
||||
}
|
||||
|
||||
$rendered
|
||||
.append($downloadButton)
|
||||
.append(' ')
|
||||
.append($openButton);
|
||||
|
|
Loading…
Reference in a new issue