moved tab management to app context

This commit is contained in:
zadam
2020-01-12 12:30:30 +01:00
parent 61474defff
commit 5e11840137
19 changed files with 235 additions and 231 deletions

View File

@@ -93,7 +93,7 @@ function AttributesModel() {
}
this.loadAttributes = async function() {
const noteId = noteDetailService.getActiveTabNoteId();
const noteId = appContext.getActiveTabNoteId();
const attributes = await server.get('notes/' + noteId + '/attributes');
@@ -139,7 +139,7 @@ function AttributesModel() {
self.updateAttributePositions();
const noteId = noteDetailService.getActiveTabNoteId();
const noteId = appContext.getActiveTabNoteId();
const attributesToSave = self.ownedAttributes()
.map(attribute => attribute())
@@ -171,7 +171,7 @@ function AttributesModel() {
toastService.showMessage("Attributes have been saved.");
const ctx = noteDetailService.getActiveTabContext();
const ctx = appContext.getActiveTabContext();
ctx.attributes.refreshAttributes();

View File

@@ -31,7 +31,7 @@ export async function showDialog() {
}
$dialog.on('shown.bs.modal', () => {
const note = noteDetailService.getActiveTabNote();
const note = appContext.getActiveTabNote();
linkMapService = new LinkMapService(note, $linkMapContainer, getOptions());
linkMapService.render();

View File

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

View File

@@ -16,7 +16,7 @@ export function showDialog() {
$dialog.modal();
const activeNote = noteDetailService.getActiveTabNote();
const activeNote = appContext.getActiveTabNote();
$noteId.text(activeNote.noteId);
$dateCreated.text(activeNote.dateCreated);

View File

@@ -25,7 +25,7 @@ let note;
let noteRevisionId;
export async function showCurrentNoteRevisions() {
await showNoteRevisionsDialog(noteDetailService.getActiveTabNoteId());
await showNoteRevisionsDialog(appContext.getActiveTabNoteId());
}
export async function showNoteRevisionsDialog(noteId, noteRevisionId) {
@@ -42,7 +42,7 @@ async function loadNoteRevisions(noteId, noteRevId) {
$list.empty();
$content.empty();
note = noteDetailService.getActiveTabNote();
note = appContext.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 = noteDetailService.getActiveTabNote().content;
const noteText = appContext.getActiveTabNote().content;
$noteSource.text(formatHtml(noteText));
}