From 63c32b6b21976a28e26c329967efbe9226f4df9a Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 5 Jun 2017 15:38:40 -0400 Subject: [PATCH] FIX: Don't animate the progress bar unless scrolling --- .../javascripts/discourse/components/topic-progress.js.es6 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/components/topic-progress.js.es6 b/app/assets/javascripts/discourse/components/topic-progress.js.es6 index f20f47426d7..9e48d70c2f1 100644 --- a/app/assets/javascripts/discourse/components/topic-progress.js.es6 +++ b/app/assets/javascripts/discourse/components/topic-progress.js.es6 @@ -92,10 +92,14 @@ export default Ember.Component.extend({ if (!this._totalWidth) { this._totalWidth = $topicProgress[0].offsetWidth; } + + // Only show percentage once we have one + if (!this._streamPercentage) { return; } + const totalWidth = this._totalWidth; const progressWidth = (this._streamPercentage || 0) * totalWidth; - const borderSize = (progressWidth === totalWidth) ? "0px" : "1px"; + const $bg = $topicProgress.find('.bg'); if ($bg.length === 0) { const style = `border-right-width: ${borderSize}; width: ${progressWidth}px`;