From f3e191c12e71df3f52a910ea28576a68cfb0dcef Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Sat, 20 Feb 2021 16:00:40 +0200 Subject: [PATCH] Fixed: Inserting properties to the tree now animate correctly to the inserted property --- .../creature/creatureProperties/methods/insertProperty.js | 2 +- .../ui/creature/character/characterSheetTabs/TreeTab.vue | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/imports/api/creature/creatureProperties/methods/insertProperty.js b/app/imports/api/creature/creatureProperties/methods/insertProperty.js index 21cf6c71..5ed2c45a 100644 --- a/app/imports/api/creature/creatureProperties/methods/insertProperty.js +++ b/app/imports/api/creature/creatureProperties/methods/insertProperty.js @@ -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, }); diff --git a/app/imports/ui/creature/character/characterSheetTabs/TreeTab.vue b/app/imports/ui/creature/character/characterSheetTabs/TreeTab.vue index b4c251a6..b8388c2e 100644 --- a/app/imports/ui/creature/character/characterSheetTabs/TreeTab.vue +++ b/app/imports/ui/creature/character/characterSheetTabs/TreeTab.vue @@ -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}`; } }); },