fix/improve behavior of "sorted" attribute

This commit is contained in:
zadam
2021-01-23 21:00:59 +01:00
parent 48b697f408
commit f2ca9276d6
4 changed files with 51 additions and 8 deletions

View File

@@ -133,6 +133,14 @@ class Note {
return !!this.attributes.find(attr => attr.type === type && attr.name === name);
}
hasLabel(name) {
return this.hasAttribute('label', name);
}
hasRelation(name) {
return this.hasAttribute('relation', name);
}
getLabelValue(name) {
const label = this.attributes.find(attr => attr.type === 'label' && attr.name === name);
@@ -275,6 +283,11 @@ class Note {
return arr.flat();
}
/** @return {String[]} */
get subtreeNoteIds() {
return this.subtreeNotes.map(note => note.noteId);
}
get parentCount() {
return this.parents.length;
}