diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-12-13 18:28:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-13 18:28:13 +0100 |
commit | cc75d4792610703e716fff0223cd566bff2005ad (patch) | |
tree | de2c5a07dd893354ed0287d36d480fceb98fdd46 /app/javascript/mastodon/features/ui/components/columns_area.js | |
parent | 8bf4cc72b6d1bdd4fe3f2a366946533376053ccc (diff) |
Fix layout for RTL (#6014)
Diffstat (limited to 'app/javascript/mastodon/features/ui/components/columns_area.js')
-rw-r--r-- | app/javascript/mastodon/features/ui/components/columns_area.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/ui/components/columns_area.js b/app/javascript/mastodon/features/ui/components/columns_area.js index 93ed9e605..c5b3c20d4 100644 --- a/app/javascript/mastodon/features/ui/components/columns_area.js +++ b/app/javascript/mastodon/features/ui/components/columns_area.js @@ -27,6 +27,8 @@ const componentMap = { 'LIST': ListTimeline, }; +const isRtlLayout = document.getElementsByTagName('body')[0].classList.contains('rtl'); + @component => injectIntl(component, { withRef: true }) export default class ColumnsArea extends ImmutablePureComponent { @@ -79,7 +81,8 @@ export default class ColumnsArea extends ImmutablePureComponent { handleChildrenContentChange() { if (!this.props.singleColumn) { - this._interruptScrollAnimation = scrollRight(this.node, this.node.scrollWidth - window.innerWidth); + const modifier = isRtlLayout ? -1 : 1; + this._interruptScrollAnimation = scrollRight(this.node, (this.node.scrollWidth - window.innerWidth) * modifier); } } |