fix renaming existing attributes + added new label autoReadOnlyDisabled to control automatic setting to readOnly mode

This commit is contained in:
zadam
2020-05-06 21:41:14 +02:00
parent 62b993f06f
commit 5d8808a2ad
3 changed files with 33 additions and 28 deletions

View File

@@ -186,7 +186,9 @@ export default class NoteDetailWidget extends TabAwareWidget {
const noteComplement = await this.tabContext.getNoteComplement();
if (note.hasLabel('readOnly') ||
(noteComplement.content && noteComplement.content.length > 10000)) {
(noteComplement.content
&& noteComplement.content.length > 10000)
&& !note.hasLabel('autoReadOnlyDisabled')) {
type = 'read-only-text';
}
}
@@ -195,7 +197,9 @@ export default class NoteDetailWidget extends TabAwareWidget {
const noteComplement = await this.tabContext.getNoteComplement();
if (note.hasLabel('readOnly') ||
(noteComplement.content && noteComplement.content.length > 30000)) {
(noteComplement.content
&& noteComplement.content.length > 30000)
&& !note.hasLabel('autoReadOnlyDisabled')) {
type = 'read-only-code';
}
}