20 lines
517 B
JavaScript
20 lines
517 B
JavaScript
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);
|
|
}
|
|
}
|
|
}); |