Added ability to add/remove basic conditions
Conditions are those listed in ./lib/methods/conditions.js
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<template name="buffViewList">
|
||||
<div>
|
||||
<paper-material class="card">
|
||||
<div class="top white subhead layout horizontal center">
|
||||
<div class="flex">Conditions</div>
|
||||
{{#if canEditCharacter _id}}
|
||||
<paper-icon-button class="black54" id="addBuff" icon="add"></paper-icon-button>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div flex class="bottom list">
|
||||
{{#each buffs}}
|
||||
{{>buffView}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</paper-material>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,28 @@
|
||||
Template.buffViewList.helpers({
|
||||
buffs: function(){
|
||||
var selector = {
|
||||
// "parent.id": this.parentId,
|
||||
"charId": this._id,
|
||||
};
|
||||
// if (this.parentGroup){
|
||||
// selector["parent.group"] = this.parentGroup;
|
||||
// }
|
||||
return Buffs.find(selector);
|
||||
}
|
||||
});
|
||||
|
||||
Template.buffViewList.events({
|
||||
"click #addBuff": function(event, template){
|
||||
pushDialogStack({
|
||||
template: "conditionLibraryDialog",
|
||||
element: event.currentTarget,
|
||||
callback: (result) => {
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
else Meteor.call("giveCondition", this._id, result)
|
||||
},
|
||||
//returnElement: () => $(`[data-id='${itemId}']`).get(0),
|
||||
})
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user