add symbol to shared notes in the tree

This commit is contained in:
zadam 2021-12-22 15:01:54 +01:00
parent bc9903191e
commit 94e18dfb7c
4 changed files with 32 additions and 2 deletions

View file

@ -778,6 +778,26 @@ class NoteShort {
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;

View file

@ -661,7 +661,10 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
extraClasses.push("protected");
}
if (note.getParentNoteIds().length > 1) {
if (note.isShared()) {
extraClasses.push("shared");
}
else if (note.getParentNoteIds().length > 1) {
const notSearchParents = note.getParentNoteIds()
.map(noteId => froca.notes[noteId])
.filter(note => !!note)

View file

@ -50,5 +50,8 @@ export default class SharedInfoWidget extends NoteContextAwareWidget {
if (loadResults.getAttributes().find(attr => attr.name.startsWith("share") && attributeService.isAffecting(attr, this.note))) {
this.refresh();
}
else if (loadResults.getBranches().find(branch => branch.noteId === this.noteId)) {
this.refresh();
}
}
}

View file

@ -135,7 +135,11 @@ span.fancytree-node.protected > span.fancytree-custom-icon {
}
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 {