Implemented a javascript code style
This commit is contained in:
@@ -7,7 +7,11 @@ Schemas.SpellLists = new SimpleSchema({
|
||||
saveDC: {type: String, optional: true, trim: false},
|
||||
attackBonus: {type: String, optional: true, trim: false},
|
||||
maxPrepared: {type: String, optional: true, trim: false},
|
||||
color: {type: String, allowedValues: _.pluck(colorOptions, "key"), defaultValue: "q"},
|
||||
color: {
|
||||
type: String,
|
||||
allowedValues: _.pluck(colorOptions, "key"),
|
||||
defaultValue: "q",
|
||||
},
|
||||
"settings.showUnprepared": {type: Boolean, defaultValue: true},
|
||||
});
|
||||
|
||||
@@ -16,14 +20,17 @@ SpellLists.attachSchema(Schemas.SpellLists);
|
||||
SpellLists.helpers({
|
||||
numPrepared: function(){
|
||||
var num = 0;
|
||||
Spells.find({charId: this.charId, listId: this._id, prepared: 1}, {fields: {prepareCost: 1}}).forEach(function(spell){
|
||||
Spells.find(
|
||||
{charId: this.charId, listId: this._id, prepared: 1},
|
||||
{fields: {prepareCost: 1}}
|
||||
).forEach(function(spell){
|
||||
num += spell.prepareCost;
|
||||
});
|
||||
return num;
|
||||
}
|
||||
});
|
||||
|
||||
SpellLists.attachBehaviour('softRemovable');
|
||||
SpellLists.attachBehaviour("softRemovable");
|
||||
makeParent(SpellLists); //parents of spells
|
||||
|
||||
SpellLists.allow(CHARACTER_SUBSCHEMA_ALLOW);
|
||||
|
||||
Reference in New Issue
Block a user