mirror of
https://github.com/zadam/trilium.git
synced 2025-10-31 18:36:30 +01:00
added "edit" button into ribbon button container
This commit is contained in:
@@ -40,8 +40,8 @@ class NoteContext extends Component {
|
||||
this.notePath = resolvedNotePath;
|
||||
this.noteId = treeService.getNoteIdFromNotePath(resolvedNotePath);
|
||||
|
||||
this.textPreviewDisabled = false;
|
||||
this.codePreviewDisabled = false;
|
||||
this.readOnlyTemporarilyDisabled = false;
|
||||
this.readOnlyTemporarilyDisabled = false;
|
||||
|
||||
this.saveToRecentNotes(resolvedNotePath);
|
||||
|
||||
@@ -177,6 +177,28 @@ class NoteContext extends Component {
|
||||
});
|
||||
}
|
||||
|
||||
async isReadOnly() {
|
||||
if (this.readOnlyTemporarilyDisabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.note.type !== 'text' && this.note.type !== 'code') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.note.hasLabel('readOnly')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const noteComplement = await this.getNoteComplement();
|
||||
|
||||
const SIZE_LIMIT = this.note.type === 'text' ? 10000 : 30000;
|
||||
|
||||
return noteComplement.content
|
||||
&& noteComplement.content.length > SIZE_LIMIT
|
||||
&& !this.note.hasLabel('autoReadOnlyDisabled');
|
||||
}
|
||||
|
||||
async entitiesReloadedEvent({loadResults}) {
|
||||
if (loadResults.isNoteReloaded(this.noteId)) {
|
||||
const note = await froca.getNote(this.noteId);
|
||||
|
||||
Reference in New Issue
Block a user