reimplement note source to open in a new tab

This commit is contained in:
zadam
2023-02-14 16:06:49 +01:00
parent c190296bf9
commit b1e2b5ba8e
11 changed files with 82 additions and 127 deletions

View File

@@ -187,23 +187,17 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
let type = note.type;
if (type === 'text' && await this.noteContext.isReadOnly()) {
type = 'readOnlyText';
}
if ((type === 'code' || type === 'mermaid') && await this.noteContext.isReadOnly()) {
if (type === 'text' && this.noteContext.viewScope.viewMode === 'source') {
type = 'readOnlyCode';
}
if (type === 'text') {
} else if (type === 'text' && await this.noteContext.isReadOnly()) {
type = 'readOnlyText';
} else if ((type === 'code' || type === 'mermaid') && await this.noteContext.isReadOnly()) {
type = 'readOnlyCode';
} else if (type === 'text') {
type = 'editableText';
}
if (type === 'code' || type === 'mermaid') {
} else if (type === 'code' || type === 'mermaid') {
type = 'editableCode';
}
if (type === 'launcher') {
} else if (type === 'launcher') {
type = 'doc';
}