Checked if old hitpoint slider exists before resetting it

closes #135
This commit is contained in:
Stefan Zermatten
2017-09-22 11:03:00 +02:00
parent dcd76e06e1
commit 020930b2e4

View File

@@ -16,7 +16,8 @@ Template.healthCard.onRendered(function(){
const id = Template.currentData()._id;
if (oldId !== id){
this.find("#hitPointSlider").resetOldValue();
this.find("#temporaryHitPointSlider").resetOldValue();
var thpSlider = this.find("#temporaryHitPointSlider");
thpSlider && thpSlider.resetOldValue();
oldId = id;
}
});