Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix search in "view source", closes #3929
zadam8a6002c6beff
diff --git a/src/public/app/components/note_context.js b/src/public/app/components/note_context.jsindex 94e9170355..75cd438a7d 100644--- a/src/public/app/components/note_context.js+++ b/src/public/app/components/note_context.js@@ -222,6 +222,10 @@ class NoteContext extends Component {return true;}+ if (this.viewScope.viewMode === 'source') {+ return true;+ }+const blob = await this.note.getBlob();const sizeLimit = this.note.type === 'text'diff --git a/src/public/app/widgets/buttons/edit_button.js b/src/public/app/widgets/buttons/edit_button.jsindex 112b3264c1..a161f7540f 100644--- a/src/public/app/widgets/buttons/edit_button.js+++ b/src/public/app/widgets/buttons/edit_button.js@@ -5,7 +5,9 @@ import protectedSessionHolder from "../../services/protected_session_holder.js";export default class EditButton extends OnClickButtonWidget {isEnabled() {- return super.isEnabled() && this.note;+ return super.isEnabled()+ && this.note+ && this.noteContext.viewScope.viewMode === 'default';}constructor() {diff --git a/src/public/app/widgets/toc.js b/src/public/app/widgets/toc.jsindex 0aba5dedfe..b1b72f879e 100644--- a/src/public/app/widgets/toc.js+++ b/src/public/app/widgets/toc.js@@ -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() {