mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 23:52:46 +08:00
FIX: Progress bar not updating properly sometimes
This commit is contained in:
parent
af96ef2994
commit
89c25d355d
|
@ -37,8 +37,8 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
|
|||
}
|
||||
|
||||
// speeds up stuff, bypass jquery slowness and extra checks
|
||||
var totalWidth = $topicProgress[0].offsetWidth;
|
||||
var progressWidth = this.get('controller.streamPercentage') * totalWidth;
|
||||
var totalWidth = $topicProgress[0].offsetWidth,
|
||||
progressWidth = this.get('controller.streamPercentage') * totalWidth;
|
||||
|
||||
$topicProgress.find('.bg')
|
||||
.css("border-right-width", (progressWidth === totalWidth) ? "0px" : "1px")
|
||||
|
@ -107,6 +107,11 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
|
|||
});
|
||||
});
|
||||
|
||||
// This get seems counter intuitive, but it's to trigger the observer on
|
||||
// the streamPercentage for this view. Otherwise the process bar does not
|
||||
// update.
|
||||
this.get('controller.streamPercentage');
|
||||
|
||||
this.$().on('mouseup.discourse-redirect', '.cooked a, a.track-link', function(e) {
|
||||
if ($(e.target).hasClass('mention')) { return false; }
|
||||
return Discourse.ClickTrack.trackClick(e);
|
||||
|
|
Loading…
Reference in New Issue
Block a user