Fix layout for RTL (#6014)

This commit is contained in:
Eugen Rochko authored and GitHub committed 2017-12-13 18:28:13 +01:00
1 parent 8bf4cc72b6
commit cc75d47926
2 files changed
+23 -8

No files matched your search

@@ -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);
}
}