mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 22:35:50 +01:00
added "inherit" relation, #3493
This commit is contained in:
@@ -56,7 +56,7 @@ class SAttribute extends AbstractShacaEntity {
|
||||
/** @returns {boolean} */
|
||||
get isAffectingSubtree() {
|
||||
return this.isInheritable
|
||||
|| (this.type === 'relation' && this.name === 'template');
|
||||
|| (this.type === 'relation' && ['template', 'inherit'].includes(this.name));
|
||||
}
|
||||
|
||||
/** @returns {string} */
|
||||
|
||||
@@ -167,7 +167,7 @@ class SNote extends AbstractShacaEntity {
|
||||
const templateAttributes = [];
|
||||
|
||||
for (const ownedAttr of parentAttributes) { // parentAttributes so we process also inherited templates
|
||||
if (ownedAttr.type === 'relation' && ownedAttr.name === 'template') {
|
||||
if (ownedAttr.type === 'relation' && ['template', 'inherit'].includes(ownedAttr.name)) {
|
||||
const templateNote = this.shaca.notes[ownedAttr.value];
|
||||
|
||||
if (templateNote) {
|
||||
@@ -434,8 +434,8 @@ class SNote extends AbstractShacaEntity {
|
||||
}
|
||||
|
||||
/** @returns {boolean} */
|
||||
isTemplate() {
|
||||
return !!this.targetRelations.find(rel => rel.name === 'template');
|
||||
isInherited() {
|
||||
return !!this.targetRelations.find(rel => rel.name === 'template' || rel.name === 'inherit');
|
||||
}
|
||||
|
||||
/** @returns {SAttribute[]} */
|
||||
|
||||
Reference in New Issue
Block a user