mirror of
https://github.com/zadam/trilium.git
synced 2025-11-09 14:55:50 +01:00
file upload WIP
This commit is contained in:
@@ -98,31 +98,6 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.contentSized();
|
||||
|
||||
this.$widget.on("dragover", e => e.preventDefault());
|
||||
|
||||
this.$widget.on("dragleave", e => e.preventDefault());
|
||||
|
||||
this.$widget.on("drop", async e => {
|
||||
const activeNote = appContext.tabManager.getActiveContextNote();
|
||||
|
||||
if (!activeNote) {
|
||||
return;
|
||||
}
|
||||
|
||||
const files = [...e.originalEvent.dataTransfer.files]; // chrome has issue that dataTransfer.files empties after async operation
|
||||
|
||||
const importService = await import('../services/import.js');
|
||||
|
||||
importService.uploadFiles('notes', activeNote.noteId, files, {
|
||||
safeImport: true,
|
||||
shrinkImages: true,
|
||||
textImportedAsText: true,
|
||||
codeImportedAsCode: true,
|
||||
explodeArchives: true,
|
||||
replaceUnderscoresWithSpaces: true
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async refresh() {
|
||||
|
||||
Reference in New Issue
Block a user