]> cat aescling's git repositories - mastodon.git/commitdiff
Fix the usages of Detect Passive Events (#4749)
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Thu, 31 Aug 2017 09:20:54 +0000 (18:20 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 31 Aug 2017 09:20:54 +0000 (11:20 +0200)
app/javascript/mastodon/components/column.js
app/javascript/mastodon/features/ui/components/columns_area.js

index 05a7c14369262dbe01f3ea4934a1927861e18176..e81236d265f2696b17822272def564dd96c83bf2 100644 (file)
@@ -32,7 +32,7 @@ export default class Column extends React.PureComponent {
   }
 
   componentDidMount () {
-    this.node.addEventListener('wheel', this.handleWheel,  detectPassiveEvents ? { passive: true } : false);
+    this.node.addEventListener('wheel', this.handleWheel,  detectPassiveEvents.hasSupport ? { passive: true } : false);
   }
 
   componentWillUnmount () {
index a4c60d9683f9aee979cabf7f2eec682092ec3d3c..7d84bece7342a11aeaa9e9a744a7458d38801555 100644 (file)
@@ -49,7 +49,7 @@ export default class ColumnsArea extends ImmutablePureComponent {
 
   componentDidMount() {
     if (!this.props.singleColumn) {
-      this.node.addEventListener('wheel', this.handleWheel,  detectPassiveEvents ? { passive: true } : false);
+      this.node.addEventListener('wheel', this.handleWheel,  detectPassiveEvents.hasSupport ? { passive: true } : false);
     }
     this.lastIndex = getIndex(this.context.router.history.location.pathname);
     this.setState({ shouldAnimate: true });
@@ -63,7 +63,7 @@ export default class ColumnsArea extends ImmutablePureComponent {
 
   componentDidUpdate(prevProps) {
     if (this.props.singleColumn !== prevProps.singleColumn && !this.props.singleColumn) {
-      this.node.addEventListener('wheel', this.handleWheel,  detectPassiveEvents ? { passive: true } : false);
+      this.node.addEventListener('wheel', this.handleWheel,  detectPassiveEvents.hasSupport ? { passive: true } : false);
     }
     this.lastIndex = getIndex(this.context.router.history.location.pathname);
     this.setState({ shouldAnimate: true });