0
0
Fork 0

Fix layout for RTL (#6014)

This commit is contained in:
Eugen Rochko 2017-12-13 18:28:13 +01:00 committed by GitHub
parent 8bf4cc72b6
commit cc75d47926
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 8 deletions

View file

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