Relocated the buff list to be inline in stats.html
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
<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="addCondition" icon="add"></paper-icon-button>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div flex class="bottom list">
|
||||
<div class="conditionsList">
|
||||
{{#each condition in conditions}}
|
||||
{{>buffListItem buff=condition}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{#if totalBuffs.count}}
|
||||
<div class="layout horizontal">
|
||||
<div class="paper-font-subhead flex">Buffs</div>
|
||||
<paper-button class="viewAllBuffsButton"> View All </paper-button>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="buffsList">
|
||||
{{#each buff in buffs}}
|
||||
{{>buffListItem buff=buff}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</paper-material>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,32 +0,0 @@
|
||||
Template.buffViewList.helpers({
|
||||
conditions: function(){
|
||||
var selector = {
|
||||
"charId": this._id,
|
||||
"type": "inate",
|
||||
};
|
||||
return Buffs.find(selector);
|
||||
},
|
||||
buffs: function(){
|
||||
var selector = {
|
||||
"charId": this._id,
|
||||
"type": "custom",
|
||||
};
|
||||
return Buffs.find(selector);
|
||||
}
|
||||
});
|
||||
|
||||
Template.buffViewList.events({
|
||||
"click #addCondition": 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),
|
||||
})
|
||||
},
|
||||
});
|
||||
@@ -43,7 +43,34 @@
|
||||
</paper-material>
|
||||
</div>
|
||||
<!--Condtions-->
|
||||
{{> 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="addCondition" icon="add"></paper-icon-button>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div flex class="bottom list">
|
||||
<div class="conditionsList">
|
||||
{{#each condition in conditions}}
|
||||
{{>buffListItem buff=condition}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{#if totalBuffs.count}}
|
||||
<div class="layout horizontal">
|
||||
<div class="paper-font-subhead flex">Buffs</div>
|
||||
<paper-button class="viewAllBuffsButton"> View All </paper-button>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="buffsList">
|
||||
{{#each buff in buffs}}
|
||||
{{>buffListItem buff=buff}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</paper-material>
|
||||
</div>
|
||||
<!--Skills-->
|
||||
<div>
|
||||
<paper-material class="card">
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
Template.stats.helpers({
|
||||
buffs: function() {
|
||||
return Buffs.find({charId: this._id}, {sort: {name: 1}});
|
||||
}
|
||||
conditions: function(){
|
||||
var selector = {
|
||||
"charId": this._id,
|
||||
"type": "inate",
|
||||
};
|
||||
return Buffs.find(selector);
|
||||
},
|
||||
buffs: function(){
|
||||
var selector = {
|
||||
"charId": this._id,
|
||||
"type": "custom",
|
||||
};
|
||||
return Buffs.find(selector);
|
||||
},
|
||||
})
|
||||
|
||||
Template.stats.events({
|
||||
@@ -71,4 +82,17 @@ Template.stats.events({
|
||||
element: event.currentTarget.parentElement.parentElement,
|
||||
});
|
||||
},
|
||||
"click #addCondition": 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