fixes and tweaks - readonly bar is smaller and on the right

This commit is contained in:
zadam
2020-08-27 14:54:56 +02:00
parent c8af250caa
commit 31d85ed8cc
7 changed files with 46 additions and 22 deletions

View File

@@ -1,6 +1,7 @@
import treeService from './tree.js';
import contextMenu from "./context_menu.js";
import appContext from "./app_context.js";
import treeCache from "./tree_cache.js";
function getNotePathFromUrl(url) {
const notePathMatch = /#(root[A-Za-z0-9/]*)$/.exec(url);
@@ -125,6 +126,24 @@ function linkContextMenu(e) {
});
}
async function loadReferenceLinkTitle(noteId, $el) {
const note = await treeCache.getNote(noteId, true);
let title;
if (!note) {
title = '[missing]';
}
else if (!note.isDeleted) {
title = note.title;
}
else {
title = note.isErased ? '[erased]' : `${note.title} (deleted)`;
}
$el.text(title);
}
$(document).on('click', "a", goToLink);
$(document).on('auxclick', "a", goToLink); // to handle middle button
$(document).on('contextmenu', 'a', linkContextMenu);
@@ -132,5 +151,6 @@ $(document).on('contextmenu', 'a', linkContextMenu);
export default {
getNotePathFromUrl,
createNoteLink,
goToLink
goToLink,
loadReferenceLinkTitle
};