implemented "search in subtree"

This commit is contained in:
zadam
2020-12-05 23:00:28 +01:00
parent b0e5ab7533
commit 90d33f56c3
13 changed files with 98 additions and 82 deletions

View File

@@ -1,7 +1,7 @@
import Component from "../widgets/component.js";
import appContext from "./app_context.js";
import dateNoteService from "../services/date_notes.js";
import noteCreateService from "../services/note_create.js";
import treeService from "../services/tree.js";
export default class DialogCommandExecutor extends Component {
jumpToNoteCommand() {
@@ -75,6 +75,16 @@ export default class DialogCommandExecutor extends Component {
appContext.triggerCommand('focusOnSearchDefinition', {tabId: tabContext.tabId});
}
async searchInSubtreeCommand({notePath}) {
const noteId = treeService.getNoteIdFromNotePath(notePath);
const searchNote = await dateNoteService.createSearchNote(noteId);
const tabContext = await appContext.tabManager.openTabWithNote(searchNote.noteId, true);
appContext.triggerCommand('focusOnSearchDefinition', {tabId: tabContext.tabId});
}
showBackendLogCommand() {
import("../dialogs/backend_log.js").then(d => d.showDialog());
}