mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
got rid of instanceName in tree service
This commit is contained in:
parent
91ee90d827
commit
cdf94181d2
@ -51,7 +51,7 @@ function ScriptApi(startNote, currentNote) {
|
|||||||
currentNote: currentNote,
|
currentNote: currentNote,
|
||||||
addButtonToToolbar,
|
addButtonToToolbar,
|
||||||
activateNote,
|
activateNote,
|
||||||
getInstanceName: treeService.getInstanceName,
|
getInstanceName: () => window.glob.instanceName,
|
||||||
runOnServer
|
runOnServer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,6 @@ const $createTopLevelNoteButton = $("#create-top-level-note-button");
|
|||||||
const $collapseTreeButton = $("#collapse-tree-button");
|
const $collapseTreeButton = $("#collapse-tree-button");
|
||||||
const $scrollToCurrentNoteButton = $("#scroll-to-current-note-button");
|
const $scrollToCurrentNoteButton = $("#scroll-to-current-note-button");
|
||||||
|
|
||||||
let instanceName = null; // should have better place
|
|
||||||
|
|
||||||
let startNotePath = null;
|
let startNotePath = null;
|
||||||
|
|
||||||
async function getNoteTitle(noteId, parentNoteId = null) {
|
async function getNoteTitle(noteId, parentNoteId = null) {
|
||||||
@ -656,7 +654,7 @@ function getNotePathFromAddress() {
|
|||||||
async function loadTree() {
|
async function loadTree() {
|
||||||
const resp = await server.get('tree');
|
const resp = await server.get('tree');
|
||||||
startNotePath = resp.start_note_path;
|
startNotePath = resp.start_note_path;
|
||||||
instanceName = resp.instanceName;
|
window.glob.instanceName = resp.instanceName;
|
||||||
|
|
||||||
if (document.location.hash) {
|
if (document.location.hash) {
|
||||||
startNotePath = getNotePathFromAddress();
|
startNotePath = getNotePathFromAddress();
|
||||||
@ -838,10 +836,6 @@ async function sortAlphabetically(noteId) {
|
|||||||
await reload();
|
await reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getInstanceName() {
|
|
||||||
return instanceName;
|
|
||||||
}
|
|
||||||
|
|
||||||
messagingService.subscribeToMessages(syncData => {
|
messagingService.subscribeToMessages(syncData => {
|
||||||
if (syncData.some(sync => sync.entityName === 'branches')
|
if (syncData.some(sync => sync.entityName === 'branches')
|
||||||
|| syncData.some(sync => sync.entityName === 'notes')) {
|
|| syncData.some(sync => sync.entityName === 'notes')) {
|
||||||
@ -909,6 +903,5 @@ export default {
|
|||||||
removeParentChildRelation,
|
removeParentChildRelation,
|
||||||
setParentChildRelation,
|
setParentChildRelation,
|
||||||
getSelectedNodes,
|
getSelectedNodes,
|
||||||
sortAlphabetically,
|
sortAlphabetically
|
||||||
getInstanceName
|
|
||||||
};
|
};
|
Loading…
x
Reference in New Issue
Block a user