From e58d09a463084216a832a115cad05c4849275746 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 4 Jul 2013 17:35:20 -0400 Subject: [PATCH] FIX: If the progress docked and you jumped to the top it could dissappear. --- app/assets/javascripts/discourse/views/topic_view.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/views/topic_view.js b/app/assets/javascripts/discourse/views/topic_view.js index d9469d5dd..973ce43c4 100644 --- a/app/assets/javascripts/discourse/views/topic_view.js +++ b/app/assets/javascripts/discourse/views/topic_view.js @@ -255,7 +255,6 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, { @method updatePosition **/ updatePosition: function() { - this.processSeenPosts(); var offset = window.pageYOffset || $('html').scrollTop(); @@ -277,7 +276,10 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, { // Dock the counter if necessary var $lastPost = $('article[data-post-id=' + topic.get('postStream.lastPostId') + "]"); var lastPostOffset = $lastPost.offset(); - if (!lastPostOffset) { return; } + if (!lastPostOffset) { + this.set('controller.dockedCounter', false); + return; + } this.set('controller.dockedCounter', (offset >= (lastPostOffset.top + $lastPost.height()) - $(window).height())); },