From 5597acb0ea291110cbe34fc505ce912fd0e115ac Mon Sep 17 00:00:00 2001 From: Thaum Rystra Date: Fri, 8 May 2020 15:37:07 +0200 Subject: [PATCH] Fixed spells not persisting checkbox values --- .../CreaturePropertyDialog.vue | 162 +++++++++++------- app/imports/ui/properties/forms/SpellForm.vue | 13 +- 2 files changed, 106 insertions(+), 69 deletions(-) diff --git a/app/imports/ui/creature/creatureProperties/CreaturePropertyDialog.vue b/app/imports/ui/creature/creatureProperties/CreaturePropertyDialog.vue index 97f3671f..53a972cc 100644 --- a/app/imports/ui/creature/creatureProperties/CreaturePropertyDialog.vue +++ b/app/imports/ui/creature/creatureProperties/CreaturePropertyDialog.vue @@ -1,67 +1,98 @@ @@ -117,7 +148,7 @@ export default { if (!this.model) return; let nearestCreatureAncestor = findLast( this.model.ancestors, - ref => ref.collection === "creatures" + ref => ref.collection === 'creatures' ); if (!nearestCreatureAncestor) return; return Creatures.findOne(nearestCreatureAncestor.id); @@ -131,11 +162,13 @@ export default { getPropertyName, change({path, value, ack}){ updateProperty.call({_id: this._id, path, value}, (error, result) =>{ + if (error) console.warn(error); ack && ack(error && error.reason || error); }); }, push({path, value, ack}){ pushToProperty.call({_id: this._id, path, value}, (error, result) =>{ + if (error) console.warn(error); ack && ack(error && error.reason || error); }); }, @@ -143,6 +176,7 @@ export default { let itemId = get(this.model, path)._id; path.pop(); pullFromProperty.call({_id: this._id, path, itemId}, (error, result) =>{ + if (error) console.warn(error); ack && ack(error && error.reason || error); }); }, diff --git a/app/imports/ui/properties/forms/SpellForm.vue b/app/imports/ui/properties/forms/SpellForm.vue index 44587b6b..7d9aa6c0 100644 --- a/app/imports/ui/properties/forms/SpellForm.vue +++ b/app/imports/ui/properties/forms/SpellForm.vue @@ -56,25 +56,25 @@
@@ -213,6 +213,9 @@ }, ], };}, + methods: { + log: console.log, + }, };