Implemented Features and Items granting effects, actions, attacks and spells
This commit is contained in:
19
rpg-docs/client/views/character/features/features.js
Normal file
19
rpg-docs/client/views/character/features/features.js
Normal file
@@ -0,0 +1,19 @@
|
||||
Template.features.helpers({
|
||||
features: function(){
|
||||
var features = Features.find({character: this._id});
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user