From 6d5ef89356e234b5208b5308fa00cf08459de831 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 4 Nov 2016 13:32:14 +0100 Subject: [PATCH] Reduce code duplication, add touch scrolling behaviour for webkit browsers on scrollable areas --- .../javascripts/components/components/status_list.jsx | 2 +- .../javascripts/components/features/followers/index.jsx | 2 +- .../javascripts/components/features/following/index.jsx | 2 +- .../javascripts/components/features/reblogs/index.jsx | 2 +- .../javascripts/components/features/status/index.jsx | 2 +- app/assets/stylesheets/components.scss | 7 +++++++ 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/components/components/status_list.jsx b/app/assets/javascripts/components/components/status_list.jsx index 49d4bef646..488d42dbab 100644 --- a/app/assets/javascripts/components/components/status_list.jsx +++ b/app/assets/javascripts/components/components/status_list.jsx @@ -47,7 +47,7 @@ const StatusList = React.createClass({ const { statusIds, onScrollToBottom, trackScroll } = this.props; const scrollableArea = ( -
+
{statusIds.map((statusId) => { return ; diff --git a/app/assets/javascripts/components/features/followers/index.jsx b/app/assets/javascripts/components/features/followers/index.jsx index feb849b9be..ff3f97b093 100644 --- a/app/assets/javascripts/components/features/followers/index.jsx +++ b/app/assets/javascripts/components/features/followers/index.jsx @@ -39,7 +39,7 @@ const Followers = React.createClass({ return ( -
+
{accountIds.map(id => )}
diff --git a/app/assets/javascripts/components/features/following/index.jsx b/app/assets/javascripts/components/features/following/index.jsx index 538e1aa331..bd3c3bd450 100644 --- a/app/assets/javascripts/components/features/following/index.jsx +++ b/app/assets/javascripts/components/features/following/index.jsx @@ -39,7 +39,7 @@ const Following = React.createClass({ return ( -
+
{accountIds.map(id => )}
diff --git a/app/assets/javascripts/components/features/reblogs/index.jsx b/app/assets/javascripts/components/features/reblogs/index.jsx index bec08f1eee..2b62d3a270 100644 --- a/app/assets/javascripts/components/features/reblogs/index.jsx +++ b/app/assets/javascripts/components/features/reblogs/index.jsx @@ -48,7 +48,7 @@ const Reblogs = React.createClass({ -
+
{accountIds.map(id => )}
diff --git a/app/assets/javascripts/components/features/status/index.jsx b/app/assets/javascripts/components/features/status/index.jsx index 78498039c7..553baf8630 100644 --- a/app/assets/javascripts/components/features/status/index.jsx +++ b/app/assets/javascripts/components/features/status/index.jsx @@ -114,7 +114,7 @@ const Status = React.createClass({ -
+
{ancestors} diff --git a/app/assets/stylesheets/components.scss b/app/assets/stylesheets/components.scss index 704462dc1a..80e6cb5a86 100644 --- a/app/assets/stylesheets/components.scss +++ b/app/assets/stylesheets/components.scss @@ -295,3 +295,10 @@ background: #2b90d9; color: #fff; } + +.scrollable { + overflow-y: scroll; + overflow-x: hidden; + flex: 1 1 auto; + -webkit-overflow-scrolling: touch; +}