mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 03:00:41 +01:00
new import dialog
This commit is contained in:
30
src/public/javascripts/dialogs/import.js
Normal file
30
src/public/javascripts/dialogs/import.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import treeService from '../services/tree.js';
|
||||
import exportService from "../services/export.js";
|
||||
import treeUtils from "../services/tree_utils.js";
|
||||
|
||||
const $dialog = $("#import-dialog");
|
||||
const $form = $("#import-form");
|
||||
const $noteTitle = $dialog.find(".note-title");
|
||||
|
||||
async function showDialog() {
|
||||
glob.activeDialog = $dialog;
|
||||
|
||||
const currentNode = treeService.getCurrentNode();
|
||||
$noteTitle.text(await treeUtils.getNoteTitle(currentNode.data.noteId));
|
||||
|
||||
$dialog.modal();
|
||||
}
|
||||
|
||||
$form.submit(() => {
|
||||
const currentNode = treeService.getCurrentNode();
|
||||
|
||||
exportService.importIntoNote(currentNode.data.noteId).then(() => {
|
||||
$dialog.modal('hide');
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
export default {
|
||||
showDialog
|
||||
}
|
||||
Reference in New Issue
Block a user