about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/ui
diff options
context:
space:
mode:
authorbeatrix <beatrix.bitrot@gmail.com>2017-12-26 17:03:29 -0500
committerGitHub <noreply@github.com>2017-12-26 17:03:29 -0500
commit7347bc733418651216f22f224caf656471499a08 (patch)
treeae9b93b06d6955258f5159dc4285e7ba2253b6f2 /app/javascript/flavours/glitch/features/ui
parente6ab869d956eb088eff6ce8b8b6114fb0d6d63fd (diff)
parent20ad071931ef520cdae6bf683ee52d369de8314b (diff)
Merge pull request #286 from chriswmartin/merge-vanilla-updates-into-glitch
Merge various small vanilla updates into glitch
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui')
-rw-r--r--app/javascript/flavours/glitch/features/ui/components/columns_area.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/components/columns_area.js b/app/javascript/flavours/glitch/features/ui/components/columns_area.js
index 4167ff693..91d4df93f 100644
--- a/app/javascript/flavours/glitch/features/ui/components/columns_area.js
+++ b/app/javascript/flavours/glitch/features/ui/components/columns_area.js
@@ -54,7 +54,10 @@ export default class ColumnsArea extends ImmutablePureComponent {
     if (!this.props.singleColumn) {
       this.node.addEventListener('wheel', this.handleWheel,  detectPassiveEvents.hasSupport ? { passive: true } : false);
     }
-    this.lastIndex = getIndex(this.context.router.history.location.pathname);
+
+    this.lastIndex   = getIndex(this.context.router.history.location.pathname);
+    this.isRtlLayout = document.getElementsByTagName('body')[0].classList.contains('rtl');
+
     this.setState({ shouldAnimate: true });
   }
 
@@ -80,7 +83,8 @@ export default class ColumnsArea extends ImmutablePureComponent {
 
   handleChildrenContentChange() {
     if (!this.props.singleColumn) {
-      this._interruptScrollAnimation = scrollRight(this.node, this.node.scrollWidth - window.innerWidth);
+      const modifier = this.isRtlLayout ? -1 : 1;
+      this._interruptScrollAnimation = scrollRight(this.node, (this.node.scrollWidth - window.innerWidth) * modifier);
     }
   }