mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
add symbol to shared notes in the tree
This commit is contained in:
parent
bc9903191e
commit
94e18dfb7c
@ -778,6 +778,26 @@ class NoteShort {
|
|||||||
throw new Error(`Unrecognized env type ${env} for note ${this.noteId}`);
|
throw new Error(`Unrecognized env type ${env} for note ${this.noteId}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isShared() {
|
||||||
|
for (const parentNoteId of this.parents) {
|
||||||
|
if (parentNoteId === 'root' || parentNoteId === 'none') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const parentNote = froca.notes[parentNoteId];
|
||||||
|
|
||||||
|
if (!parentNote) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parentNote.noteId === 'share' || parentNote.isShared()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NoteShort;
|
export default NoteShort;
|
||||||
|
@ -661,7 +661,10 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
|
|||||||
extraClasses.push("protected");
|
extraClasses.push("protected");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (note.getParentNoteIds().length > 1) {
|
if (note.isShared()) {
|
||||||
|
extraClasses.push("shared");
|
||||||
|
}
|
||||||
|
else if (note.getParentNoteIds().length > 1) {
|
||||||
const notSearchParents = note.getParentNoteIds()
|
const notSearchParents = note.getParentNoteIds()
|
||||||
.map(noteId => froca.notes[noteId])
|
.map(noteId => froca.notes[noteId])
|
||||||
.filter(note => !!note)
|
.filter(note => !!note)
|
||||||
|
@ -50,5 +50,8 @@ export default class SharedInfoWidget extends NoteContextAwareWidget {
|
|||||||
if (loadResults.getAttributes().find(attr => attr.name.startsWith("share") && attributeService.isAffecting(attr, this.note))) {
|
if (loadResults.getAttributes().find(attr => attr.name.startsWith("share") && attributeService.isAffecting(attr, this.note))) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
|
else if (loadResults.getBranches().find(branch => branch.noteId === this.noteId)) {
|
||||||
|
this.refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,11 @@ span.fancytree-node.protected > span.fancytree-custom-icon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
span.fancytree-node.multiple-parents .fancytree-title::after {
|
span.fancytree-node.multiple-parents .fancytree-title::after {
|
||||||
content: " *"
|
content: " *";
|
||||||
|
}
|
||||||
|
|
||||||
|
span.fancytree-node.shared .fancytree-title::after {
|
||||||
|
content: " \2197";
|
||||||
}
|
}
|
||||||
|
|
||||||
span.fancytree-node.fancytree-active-clone:not(.fancytree-active) .fancytree-title {
|
span.fancytree-node.fancytree-active-clone:not(.fancytree-active) .fancytree-title {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user