Fixed: Inserting properties to the tree now animate correctly to the inserted property

This commit is contained in:
Stefan Zermatten
2021-02-20 16:00:40 +02:00
parent 33415275a3
commit f3e191c12e
2 changed files with 5 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ const insertProperty = new ValidatedMethod({
run({creatureProperty}) {
let rootCreature = getRootCreatureAncestor(creatureProperty);
assertEditPermission(rootCreature, this.userId);
insertPropertyWork({
return insertPropertyWork({
property: creatureProperty,
creature: rootCreature,
});

View File

@@ -205,8 +205,8 @@
creatureProperty.parent = {collection: 'creatures', id: that.creatureId};
creatureProperty.ancestors = [ {collection: 'creatures', id: that.creatureId}];
setDocToLastOrder({collection: CreatureProperties, doc: creatureProperty});
let creaturePropertyId = insertProperty.call({creatureProperty});
return creaturePropertyId;
let id = insertProperty.call({creatureProperty});
return `tree-node-${id}`;
}
});
},
@@ -217,10 +217,11 @@
elementId: 'insert-creature-property-fab',
callback(libraryNode){
if (!libraryNode) return;
insertPropertyFromLibraryNode.call({
let id = insertPropertyFromLibraryNode.call({
nodeId: libraryNode._id,
parentRef: {collection: 'creatures', id: that.creatureId},
});
return `tree-node-${id}`;
}
});
},