fix(in-app-help): jumping to headings in table of contents

This commit is contained in:
Elian Doran 2025-02-02 18:35:41 +02:00
parent e41a02893f
commit ff0514a7dc
No known key found for this signature in database

View File

@ -270,10 +270,11 @@ export default class TocWidget extends RightPanelWidget {
// intervening events, do the readonly calculation at navigation // intervening events, do the readonly calculation at navigation
// time and not at outline creation time // time and not at outline creation time
// See https://github.com/zadam/trilium/issues/2828 // See https://github.com/zadam/trilium/issues/2828
const isDocNote = this.note.type === "doc";
const isReadOnly = await this.noteContext.isReadOnly(); const isReadOnly = await this.noteContext.isReadOnly();
let $container; let $container;
if (isReadOnly) { if (isReadOnly || isDocNote) {
$container = await this.noteContext.getContentElement(); $container = await this.noteContext.getContentElement();
} else { } else {
const textEditor = await this.noteContext.getTextEditor(); const textEditor = await this.noteContext.getTextEditor();