mirror of
https://github.com/zadam/trilium.git
synced 2025-11-16 10:15:52 +01:00
moved tab related stuff to tab manager from app context
This commit is contained in:
@@ -92,7 +92,7 @@ function AttributesModel() {
|
||||
}
|
||||
|
||||
this.loadAttributes = async function() {
|
||||
const noteId = appContext.getActiveTabNoteId();
|
||||
const noteId = appContext.tabManager.getActiveTabNoteId();
|
||||
|
||||
const attributes = await server.get('notes/' + noteId + '/attributes');
|
||||
|
||||
@@ -138,7 +138,7 @@ function AttributesModel() {
|
||||
|
||||
self.updateAttributePositions();
|
||||
|
||||
const noteId = appContext.getActiveTabNoteId();
|
||||
const noteId = appContext.tabManager.getActiveTabNoteId();
|
||||
|
||||
const attributesToSave = self.ownedAttributes()
|
||||
.map(attribute => attribute())
|
||||
|
||||
@@ -22,7 +22,7 @@ export async function showDialog() {
|
||||
return false;
|
||||
}
|
||||
|
||||
appContext.getActiveTabContext().setNote(suggestion.path);
|
||||
appContext.tabManager.getActiveTabContext().setNote(suggestion.path);
|
||||
});
|
||||
|
||||
noteAutocompleteService.showRecentNotes($autoComplete);
|
||||
|
||||
@@ -31,7 +31,7 @@ export async function showDialog() {
|
||||
}
|
||||
|
||||
$dialog.on('shown.bs.modal', () => {
|
||||
const note = appContext.getActiveTabNote();
|
||||
const note = appContext.tabManager.getActiveTabNote();
|
||||
|
||||
linkMapService = new LinkMapService(note, $linkMapContainer, getOptions());
|
||||
linkMapService.render();
|
||||
|
||||
@@ -29,7 +29,7 @@ async function convertMarkdownToHtml(text) {
|
||||
}
|
||||
|
||||
export async function importMarkdownInline() {
|
||||
if (appContext.getActiveTabNoteType() !== 'text') {
|
||||
if (appContext.tabManager.getActiveTabNoteType() !== 'text') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ export async function showDialog() {
|
||||
|
||||
$dialog.modal();
|
||||
|
||||
const activeTabContext = appContext.getActiveTabContext();
|
||||
const activeTabContext = appContext.tabManager.getActiveTabContext();
|
||||
const {note} = activeTabContext;
|
||||
const noteComplement = await activeTabContext.getNoteComplement();
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ let note;
|
||||
let noteRevisionId;
|
||||
|
||||
export async function showCurrentNoteRevisions() {
|
||||
await showNoteRevisionsDialog(appContext.getActiveTabNoteId());
|
||||
await showNoteRevisionsDialog(appContext.tabManager.getActiveTabNoteId());
|
||||
}
|
||||
|
||||
export async function showNoteRevisionsDialog(noteId, noteRevisionId) {
|
||||
@@ -42,7 +42,7 @@ async function loadNoteRevisions(noteId, noteRevId) {
|
||||
$list.empty();
|
||||
$content.empty();
|
||||
|
||||
note = appContext.getActiveTabNote();
|
||||
note = appContext.tabManager.getActiveTabNote();
|
||||
revisionItems = await server.get(`notes/${noteId}/revisions`);
|
||||
|
||||
for (const item of revisionItems) {
|
||||
|
||||
@@ -11,7 +11,7 @@ export function showDialog() {
|
||||
|
||||
$dialog.modal();
|
||||
|
||||
const noteText = appContext.getActiveTabNote().content;
|
||||
const noteText = appContext.tabManager.getActiveTabNote().content;
|
||||
|
||||
$noteSource.text(formatHtml(noteText));
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ export async function showDialog() {
|
||||
|
||||
await treeCache.reloadNotes([change.noteId]);
|
||||
|
||||
appContext.getActiveTabContext().setNote(change.noteId);
|
||||
appContext.tabManager.getActiveTabContext().setNote(change.noteId);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user