Merge branch 'stable'

# Conflicts:
#	src/public/app/widgets/toc.js
This commit is contained in:
zadam
2023-05-18 13:46:41 +02:00
8 changed files with 30 additions and 13 deletions

View File

@@ -69,7 +69,8 @@ export default class TocWidget extends RightPanelWidget {
isEnabled() {
return super.isEnabled()
&& this.note.type === 'text'
&& !this.noteContext.viewScope.tocTemporarilyHidden;
&& !this.noteContext.viewScope.tocTemporarilyHidden
&& this.noteContext.viewScope.viewMode === 'default';
}
async doRenderBody() {
@@ -176,9 +177,7 @@ export default class TocWidget extends RightPanelWidget {
const headingElement = $container.find(":header")[headingIndex];
if (headingElement != null) {
headingElement.scrollIntoView({
behavior: 'smooth'
});
headingElement.scrollIntoView({ behavior: "smooth" });
}
} else {
const textEditor = await this.noteContext.getTextEditor();
@@ -263,4 +262,4 @@ class CloseTocButton extends OnClickButtonWidget {
})
.class("icon-action close-toc");
}
}
}