mirror of
https://github.com/zadam/trilium.git
synced 2026-07-28 01:50:13 +02:00
fix(client): internalBookmark not hidden
This commit is contained in:
@@ -7,6 +7,10 @@ async function renderAttribute(attribute: FAttribute, renderIsInheritable: boole
|
||||
const isInheritable = renderIsInheritable && attribute.isInheritable ? `(inheritable)` : "";
|
||||
const $attr = $("<span>");
|
||||
|
||||
if (attribute.isAutoLink) {
|
||||
return $attr;
|
||||
}
|
||||
|
||||
if (attribute.type === "label") {
|
||||
$attr.append(document.createTextNode(`#${attribute.name}${isInheritable}`));
|
||||
|
||||
@@ -15,9 +19,6 @@ async function renderAttribute(attribute: FAttribute, renderIsInheritable: boole
|
||||
$attr.append(document.createTextNode(formatValue(attribute.value)));
|
||||
}
|
||||
} else if (attribute.type === "relation") {
|
||||
if (attribute.isAutoLink) {
|
||||
return $attr;
|
||||
}
|
||||
|
||||
// when the relation has just been created, then it might not have a value
|
||||
if (attribute.value) {
|
||||
|
||||
@@ -51,6 +51,10 @@ function AutoLinkAttribute({ attribute }: { attribute: FAttribute }) {
|
||||
}
|
||||
|
||||
async function renderAutoLink(attribute: FAttribute) {
|
||||
if (attribute.type === "label") {
|
||||
return `#${escapeHtml(attribute.name)}=${escapeHtml(attribute.value)}`;
|
||||
}
|
||||
|
||||
const note = await froca.getNote(attribute.value);
|
||||
if (!note) return "";
|
||||
|
||||
|
||||
@@ -264,13 +264,6 @@ export default function EditableText({ note, parentComponent, ntxId, noteContext
|
||||
editor.setData(contentRef.current);
|
||||
parentComponent?.triggerEvent("textEditorRefreshed", { ntxId, editor });
|
||||
|
||||
// Scroll to bookmark anchor if navigated with ?bookmark=...
|
||||
const viewScope = noteContext?.viewScope;
|
||||
if (viewScope?.bookmark) {
|
||||
const el = editor.editing.view.getDomRoot()?.querySelector(`[id="${CSS.escape(viewScope.bookmark)}"]`);
|
||||
el?.scrollIntoView({ behavior: "smooth", block: "center" });
|
||||
viewScope.bookmark = undefined;
|
||||
}
|
||||
}}
|
||||
/>}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user