Fixed some editing bugs on new buffs, improved style
This commit is contained in:
@@ -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