Began implementing features that change stats

This commit is contained in:
Thaum
2014-11-03 14:07:55 +00:00
parent 25b2a95f14
commit 0d941bff47
8 changed files with 103 additions and 77 deletions

View File

@@ -0,0 +1,20 @@
Template.features.helpers = {
features: function(){
var features = Features.find({character: this._id});
console.log('found: ', features);
return features;
}
}
Template.features.events = {
// Fires when any element is clicked
'change .enabled': function (event) {
var enable = event.target.checked
Features.update(this._id, {$set: {enabled: enable}});
if(enable){
Template.parentData(1).pushEffects(this.name, this.effects);
} else {
Template.parentData(1).pullEffects(this.effects);
}
}
}