From 8a58002415081a47629b2ea511d3f2906e1602c3 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Fri, 22 Sep 2017 10:42:34 +0200 Subject: [PATCH] Fixed spells in the library using their library ID's in the spells collection closes #137 --- rpg-docs/client/views/character/spells/spells.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rpg-docs/client/views/character/spells/spells.js b/rpg-docs/client/views/character/spells/spells.js index 247445f0..e2b4da76 100644 --- a/rpg-docs/client/views/character/spells/spells.js +++ b/rpg-docs/client/views/character/spells/spells.js @@ -267,9 +267,11 @@ Template.spells.events({ //loop through all returned spells _.each(resultArray, (rawSpell, index) =>{ // Make the library spell into a regular spell - let spell = _.omit(rawSpell, "library", "attacks", "effects"); + let spell = _.omit(rawSpell, "_id", "library", "attacks", "effects"); + // Use the ID generated earlier for the first spell so we + // can animate to it if (index == 0) { - spell._id = spellId; //only do this for the first spell added + spell._id = spellId; } spell.charId = charId; spell.parent = {