Fixed some editing bugs on new buffs, improved style
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<template name="customBuffView">
|
||||
<td>{{buff.name}}</td>
|
||||
<td>
|
||||
<div class="flex">{{buff.name}}</div>
|
||||
<div class="flex">
|
||||
{{#if canEditCharacter buff.charId}}
|
||||
<paper-button class="apply-buff-button">Apply{{toSelf}}</paper-button>
|
||||
{{/if}}
|
||||
</td>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -41,7 +41,16 @@ const applyBuff = function(targetId, buff) {
|
||||
|
||||
Proficiencies.insert(temp);
|
||||
});
|
||||
}
|
||||
|
||||
let target;
|
||||
if (targetId == buff.charId) {
|
||||
target = "self";
|
||||
} else {
|
||||
target = Characters.findOne(targetId) || {};
|
||||
target = target && target.name || "target"
|
||||
}
|
||||
GlobalUI.toast(`${buff.name || "Buff"} applied to ${target}`);
|
||||
};
|
||||
|
||||
Template.customBuffView.helpers({
|
||||
toSelf: function() {
|
||||
@@ -65,10 +74,9 @@ Template.customBuffView.events({
|
||||
applyBuff(targetId, this.buff);
|
||||
},
|
||||
});
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var targetId = this.buff.charId;
|
||||
applyBuff(targetId, this.buff);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user