TimerView: Update only as often as 500ms

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-06-06 15:18:03 -07:00
parent 5351b60365
commit 9a09e7a16b

View file

@ -41,8 +41,8 @@
var remainingTime = this.model.msTilExpire();
var elapsed = (totalTime - remainingTime) / totalTime;
this.$('.sand').css('transform', 'translateY(' + elapsed*100 + '%)');
this.timeout = setTimeout(this.update.bind(this), totalTime / 100);
this.$el.css('display', 'inline-block');
this.timeout = setTimeout(this.update.bind(this), Math.max(totalTime / 100, 500));
}
return this;
}