attachment preview, closes #210

This commit is contained in:
azivner
2018-11-16 18:40:58 +01:00
parent 94565e3ec0
commit 6b65592d7a
4 changed files with 30 additions and 2 deletions

View File

@@ -8,6 +8,8 @@ const $component = $('#note-detail-file');
const $fileName = $("#file-filename");
const $fileType = $("#file-filetype");
const $fileSize = $("#file-filesize");
const $previewRow = $("#file-preview-row");
const $previewContent = $("#file-preview-content");
const $downloadButton = $("#file-download");
const $openButton = $("#file-open");
@@ -22,6 +24,9 @@ async function show() {
$fileName.text(attributeMap.originalFileName || "?");
$fileSize.text((attributeMap.fileSize || "?") + " bytes");
$fileType.text(currentNote.mime);
$previewRow.toggle(!!currentNote.content);
$previewContent.text(currentNote.content);
}
$downloadButton.click(() => utils.download(getFileUrl()));