From 80b195b7f7a49724030bcf54c0ee39ffb5441333 Mon Sep 17 00:00:00 2001 From: Jacob Date: Sat, 24 Feb 2018 14:42:41 +0000 Subject: [PATCH] Added reset button to resource cards --- rpg-docs/client/views/character/features/features.html | 3 +++ rpg-docs/client/views/character/features/features.js | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/rpg-docs/client/views/character/features/features.html b/rpg-docs/client/views/character/features/features.html index a3c6f1df..c99053f7 100644 --- a/rpg-docs/client/views/character/features/features.html +++ b/rpg-docs/client/views/character/features/features.html @@ -133,6 +133,9 @@
{{title}}
+
+ Reset +
{{/if}} diff --git a/rpg-docs/client/views/character/features/features.js b/rpg-docs/client/views/character/features/features.js index 17873a2f..d6cc1ea5 100644 --- a/rpg-docs/client/views/character/features/features.js +++ b/rpg-docs/client/views/character/features/features.js @@ -129,6 +129,11 @@ Template.resource.helpers({ }); Template.resource.events({ + "click .resourceReset": function(event){ + var modifier = {$set: {}}; + modifier.$set[this.name + ".adjustment"] = 0; + Characters.update(this.char._id, modifier, {validate: false}); + }, "click .resourceUp": function(event){ var value = Characters.calculate.attributeValue(this.char._id, this.name); var base = Characters.calculate.attributeBase(this.char._id, this.name);