]> cat aescling's git repositories - mastodon.git/commitdiff
add scrollTop to ui/components/column (#4563)
authorOndřej Hruška <ondra@ondrovo.com>
Tue, 8 Aug 2017 22:21:58 +0000 (00:21 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Tue, 8 Aug 2017 22:21:58 +0000 (00:21 +0200)
app/javascript/mastodon/features/ui/components/column.js

index 9031c16fc29596c2dc6dd418308a796ef11cd186..15538ea387a66d109b94e5c641d261ad31179a7f 100644 (file)
@@ -25,6 +25,17 @@ export default class Column extends React.PureComponent {
     this._interruptScrollAnimation = scrollTop(scrollable);
   }
 
+  scrollTop () {
+    const scrollable = this.node.querySelector('.scrollable');
+
+    if (!scrollable) {
+      return;
+    }
+
+    this._interruptScrollAnimation = scrollTop(scrollable);
+  }
+
+
   handleScroll = debounce(() => {
     if (typeof this._interruptScrollAnimation !== 'undefined') {
       this._interruptScrollAnimation();