Fixed: Inserting properties to the tree now animate correctly to the inserted property
This commit is contained in:
@@ -18,7 +18,7 @@ const insertProperty = new ValidatedMethod({
|
|||||||
run({creatureProperty}) {
|
run({creatureProperty}) {
|
||||||
let rootCreature = getRootCreatureAncestor(creatureProperty);
|
let rootCreature = getRootCreatureAncestor(creatureProperty);
|
||||||
assertEditPermission(rootCreature, this.userId);
|
assertEditPermission(rootCreature, this.userId);
|
||||||
insertPropertyWork({
|
return insertPropertyWork({
|
||||||
property: creatureProperty,
|
property: creatureProperty,
|
||||||
creature: rootCreature,
|
creature: rootCreature,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -205,8 +205,8 @@
|
|||||||
creatureProperty.parent = {collection: 'creatures', id: that.creatureId};
|
creatureProperty.parent = {collection: 'creatures', id: that.creatureId};
|
||||||
creatureProperty.ancestors = [ {collection: 'creatures', id: that.creatureId}];
|
creatureProperty.ancestors = [ {collection: 'creatures', id: that.creatureId}];
|
||||||
setDocToLastOrder({collection: CreatureProperties, doc: creatureProperty});
|
setDocToLastOrder({collection: CreatureProperties, doc: creatureProperty});
|
||||||
let creaturePropertyId = insertProperty.call({creatureProperty});
|
let id = insertProperty.call({creatureProperty});
|
||||||
return creaturePropertyId;
|
return `tree-node-${id}`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -217,10 +217,11 @@
|
|||||||
elementId: 'insert-creature-property-fab',
|
elementId: 'insert-creature-property-fab',
|
||||||
callback(libraryNode){
|
callback(libraryNode){
|
||||||
if (!libraryNode) return;
|
if (!libraryNode) return;
|
||||||
insertPropertyFromLibraryNode.call({
|
let id = insertPropertyFromLibraryNode.call({
|
||||||
nodeId: libraryNode._id,
|
nodeId: libraryNode._id,
|
||||||
parentRef: {collection: 'creatures', id: that.creatureId},
|
parentRef: {collection: 'creatures', id: that.creatureId},
|
||||||
});
|
});
|
||||||
|
return `tree-node-${id}`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user