moved tab related stuff to tab manager from app context

This commit is contained in:
zadam
2020-02-07 21:08:55 +01:00
parent 6d912c4897
commit 14d6372bd8
29 changed files with 331 additions and 332 deletions

View File

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

View File

@@ -22,7 +22,7 @@ export async function showDialog() {
return false;
}
appContext.getActiveTabContext().setNote(suggestion.path);
appContext.tabManager.getActiveTabContext().setNote(suggestion.path);
});
noteAutocompleteService.showRecentNotes($autoComplete);

View File

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

View File

@@ -29,7 +29,7 @@ async function convertMarkdownToHtml(text) {
}
export async function importMarkdownInline() {
if (appContext.getActiveTabNoteType() !== 'text') {
if (appContext.tabManager.getActiveTabNoteType() !== 'text') {
return;
}

View File

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

View File

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

View File

@@ -11,7 +11,7 @@ export function showDialog() {
$dialog.modal();
const noteText = appContext.getActiveTabNote().content;
const noteText = appContext.tabManager.getActiveTabNote().content;
$noteSource.text(formatHtml(noteText));
}

View File

@@ -55,7 +55,7 @@ export async function showDialog() {
await treeCache.reloadNotes([change.noteId]);
appContext.getActiveTabContext().setNote(change.noteId);
appContext.tabManager.getActiveTabContext().setNote(change.noteId);
}
});