mirror of
https://github.com/zadam/trilium.git
synced 2025-11-15 09:45:52 +01:00
moved tab management to app context
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -26,7 +26,7 @@ async function convertMarkdownToHtml(text) {
|
||||
}
|
||||
|
||||
export async function importMarkdownInline() {
|
||||
if (noteDetailService.getActiveTabNoteType() !== 'text') {
|
||||
if (appContext.getActiveTabNoteType() !== 'text') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -11,7 +11,7 @@ export function showDialog() {
|
||||
|
||||
$dialog.modal();
|
||||
|
||||
const noteText = noteDetailService.getActiveTabNote().content;
|
||||
const noteText = appContext.getActiveTabNote().content;
|
||||
|
||||
$noteSource.text(formatHtml(noteText));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user