file upload WIP

This commit is contained in:
zadam
2023-06-06 12:31:38 +02:00
parent 0234ff5fca
commit 38839532d5
7 changed files with 24 additions and 29 deletions

View File

@@ -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() {