Fixed some editing bugs on new buffs, improved style

This commit is contained in:
Stefan Zermatten
2017-09-07 14:33:59 +02:00
parent e2933c2df5
commit b43ee08d75
8 changed files with 45 additions and 23 deletions

View File

@@ -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);
}
},
});
});