mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 13:26:01 +01:00
clean up tree service WIP
This commit is contained in:
@@ -4,6 +4,7 @@ import utils from "../services/utils.js";
|
||||
import dateNoteService from "../services/date_notes.js";
|
||||
import treeService from "../services/tree.js";
|
||||
import server from "../services/server.js";
|
||||
import appContext from "../services/app_context.js";
|
||||
|
||||
const TPL = `
|
||||
<div class="calendar-widget">
|
||||
@@ -58,7 +59,7 @@ export default class CalendarWidget extends CollapsibleWidget {
|
||||
const note = await dateNoteService.getDateNote(date);
|
||||
|
||||
if (note) {
|
||||
treeService.activateNote(note.noteId);
|
||||
appContext.getActiveTabContext().setNote(note.noteId);
|
||||
}
|
||||
else {
|
||||
alert("Cannot find day note");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import noteAutocompleteService from '../../services/note_autocomplete.js';
|
||||
import treeService from "../../services/tree.js";
|
||||
import TypeWidget from "./type_widget.js";
|
||||
import appContext from "../../services/app_context.js";
|
||||
|
||||
const TPL = `
|
||||
<div class="note-detail-empty note-detail-printable">
|
||||
@@ -27,7 +28,7 @@ export default class EmptyTypeWidget extends TypeWidget {
|
||||
return false;
|
||||
}
|
||||
|
||||
treeService.activateNote(suggestion.path);
|
||||
appContext.getActiveTabContext().setNote(suggestion.path);
|
||||
});
|
||||
|
||||
noteAutocompleteService.showRecentNotes(this.$autoComplete);
|
||||
|
||||
@@ -4,6 +4,7 @@ import noteAutocompleteService from '../../services/note_autocomplete.js';
|
||||
import mimeTypesService from '../../services/mime_types.js';
|
||||
import TypeWidget from "./type_widget.js";
|
||||
import utils from "../../services/utils.js";
|
||||
import appContext from "../../services/app_context.js";
|
||||
|
||||
const ENABLE_INSPECTOR = false;
|
||||
|
||||
@@ -90,7 +91,7 @@ export default class TextTypeWidget extends TypeWidget {
|
||||
if (match) {
|
||||
const noteId = match[1];
|
||||
|
||||
treeService.activateNote(noteId);
|
||||
appContext.getActiveTabContext().setNote(noteId);
|
||||
}
|
||||
else {
|
||||
window.open(src, '_blank');
|
||||
|
||||
Reference in New Issue
Block a user