Add config option to change automatic readonly size (#2174)

This commit is contained in:
Abitofevrything
2021-09-20 21:08:41 +02:00
committed by GitHub
parent bdde52f004
commit b85cf07a28
4 changed files with 46 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import treeService from "./tree.js";
import Component from "../widgets/component.js";
import froca from "./froca.js";
import hoistedNoteService from "./hoisted_note.js";
import options from "./options.js";
class NoteContext extends Component {
/**
@@ -192,7 +193,9 @@ class NoteContext extends Component {
const noteComplement = await this.getNoteComplement();
const SIZE_LIMIT = this.note.type === 'text' ? 10000 : 30000;
const SIZE_LIMIT = this.note.type === 'text' ?
options.getInt('autoReadonlySize')
: options.getInt('autoCodeReadonlySize');
return noteComplement.content
&& noteComplement.content.length > SIZE_LIMIT