about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorMatt Panaro <matt.panaro@gmail.com>2019-12-31 15:39:25 -0500
committerEugen Rochko <eugen@zeonfederated.com>2019-12-31 21:39:25 +0100
commit2a5da8c9613b0ef6659edc60831b4fe8e84f3fc8 (patch)
treec60821674cdfcd23864c9ac3ad24ff60ccbb964a /app/javascript
parent3b3bdc7293493735a2169d3377a5a5b7d9006497 (diff)
refactor IntersectionObserver to observe viewport in single-column mode (#12735)
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/mastodon/components/scrollable_list.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/javascript/mastodon/components/scrollable_list.js b/app/javascript/mastodon/components/scrollable_list.js
index 6338ccd5c..e4adabb36 100644
--- a/app/javascript/mastodon/components/scrollable_list.js
+++ b/app/javascript/mastodon/components/scrollable_list.js
@@ -210,10 +210,13 @@ export default class ScrollableList extends PureComponent {
   }
 
   attachIntersectionObserver () {
-    this.intersectionObserverWrapper.connect({
+    let nodeOptions = {
       root: this.node,
       rootMargin: '300% 0px',
-    });
+    };
+
+    this.intersectionObserverWrapper
+      .connect(this.props.bindToDocument ? {} : nodeOptions);
   }
 
   detachIntersectionObserver () {