Moved views out of private folder
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
<!--needs to be given charId, parentId and parentCollection-->
|
||||
<template name="effectsEditList">
|
||||
{{#if effects.count}}
|
||||
<hr class="vertMargin">
|
||||
<div id="effects">
|
||||
<h2>Effects</h2>
|
||||
{{#each effects}}
|
||||
{{>effectEdit}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<paper-button id="addEffectButton" class="red-button" raised>Add Effect</paper-button>
|
||||
</template>
|
||||
@@ -0,0 +1,33 @@
|
||||
Template.effectsEditList.helpers({
|
||||
effects: function(){
|
||||
var selector = {
|
||||
"parent.id": this.parentId,
|
||||
"parent.collection": this.parentCollection,
|
||||
"charId": this.charId,
|
||||
};
|
||||
if (this.parentGroup){
|
||||
selector["parent.group"] = this.parentGroup;
|
||||
}
|
||||
var cursor = Effects.find(selector);
|
||||
return cursor;
|
||||
}
|
||||
});
|
||||
|
||||
Template.effectsEditList.events({
|
||||
"tap #addEffectButton": function(){
|
||||
if (!_.isBoolean(this.enabled)) {
|
||||
this.enabled = true;
|
||||
}
|
||||
Effects.insert({
|
||||
name: this.name,
|
||||
charId: this.charId,
|
||||
parent: {
|
||||
id: this.parentId,
|
||||
collection: this.parentCollection,
|
||||
group: this.parentGroup,
|
||||
},
|
||||
operation: "add",
|
||||
enabled: this.enabled,
|
||||
});
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user