From c76e6e173e936bbb5833e41b50e768d0ec663331 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 8 Feb 2016 13:22:14 -0500 Subject: [PATCH] FIX: Include small actions when determining what's on screen --- .../discourse/components/scrolling-post-stream.js.es6 | 2 +- .../javascripts/discourse/widgets/post-small-action.js.es6 | 2 +- app/assets/javascripts/discourse/widgets/post.js.es6 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/components/scrolling-post-stream.js.es6 b/app/assets/javascripts/discourse/components/scrolling-post-stream.js.es6 index 0e8fc7751..83cbcbebb 100644 --- a/app/assets/javascripts/discourse/components/scrolling-post-stream.js.es6 +++ b/app/assets/javascripts/discourse/components/scrolling-post-stream.js.es6 @@ -43,7 +43,7 @@ export default MountWidget.extend({ let windowTop = $w.scrollTop(); - const $posts = this.$('article.boxed'); + const $posts = this.$('.onscreen-post'); const viewportTop = windowTop - slack; const topView = findTopView($posts, viewportTop, 0, $posts.length-1); diff --git a/app/assets/javascripts/discourse/widgets/post-small-action.js.es6 b/app/assets/javascripts/discourse/widgets/post-small-action.js.es6 index e4590e1d4..699e97dd0 100644 --- a/app/assets/javascripts/discourse/widgets/post-small-action.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-small-action.js.es6 @@ -23,7 +23,7 @@ const icons = { }; export default createWidget('post-small-action', { - tagName: 'div.small-action.clearfix', + tagName: 'div.small-action.onscreen-post.clearfix', html(attrs) { const contents = []; diff --git a/app/assets/javascripts/discourse/widgets/post.js.es6 b/app/assets/javascripts/discourse/widgets/post.js.es6 index 06916e942..26ed9f4e4 100644 --- a/app/assets/javascripts/discourse/widgets/post.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post.js.es6 @@ -295,7 +295,7 @@ createWidget('post-body', { }); createWidget('post-article', { - tagName: 'article.boxed', + tagName: 'article.boxed.onscreen-post', buildKey: attrs => `post-article-${attrs.id}`, defaultState() {