mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 01:56:01 -05:00
FIX: If the progress docked and you jumped to the top it could dissappear.
This commit is contained in:
parent
2d821d1ff4
commit
e58d09a463
1 changed files with 4 additions and 2 deletions
|
@ -255,7 +255,6 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
|
||||||
@method updatePosition
|
@method updatePosition
|
||||||
**/
|
**/
|
||||||
updatePosition: function() {
|
updatePosition: function() {
|
||||||
|
|
||||||
this.processSeenPosts();
|
this.processSeenPosts();
|
||||||
|
|
||||||
var offset = window.pageYOffset || $('html').scrollTop();
|
var offset = window.pageYOffset || $('html').scrollTop();
|
||||||
|
@ -277,7 +276,10 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
|
||||||
// Dock the counter if necessary
|
// Dock the counter if necessary
|
||||||
var $lastPost = $('article[data-post-id=' + topic.get('postStream.lastPostId') + "]");
|
var $lastPost = $('article[data-post-id=' + topic.get('postStream.lastPostId') + "]");
|
||||||
var lastPostOffset = $lastPost.offset();
|
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()));
|
this.set('controller.dockedCounter', (offset >= (lastPostOffset.top + $lastPost.height()) - $(window).height()));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue