Files
DiceCloud/rpg-docs/client/views/character/features/features.js
Thaum 6a2e7f0832 Gave effects their own collection, they no longer live in arrays attached to skills/attributes
Also improved the display of features and generally iterated on their manipulation.

Characters now fetch the relevant effects directly when making a calculation, simplifying almost everything.

Effects now store a reference to their source if they have one.

Effect names are now optional, they can be fetched from the source's name if the source exists.
2015-01-23 11:04:07 +00:00

27 lines
710 B
JavaScript

Template.features.helpers({
features: function(){
var features = Features.find({charId: this._id});
return features;
}
});
Template.features.events({
"tap #addFeature": function(event){
var featureId = Features.insert({name: "New Feature", charId: this._id});
GlobalUI.showDialog({
heading: "New Feature",
template: "featureDialog",
data: {featureId: featureId, charId: this._id},
fullOnMobile: true
})
},
"tap .featureCard": function(event){
var featureId = this._id;
GlobalUI.setDialog({
heading: this.name,
template: "featureDialog",
data: {featureId: featureId, charId: Template.parentData()._id},
fullOnMobile: true
})
}
});