Bug 1312687 - devtools-side-splitter now moves the correct direction in RTL locales r=ntim
authorNick <nick@foxsec.io>
Thu, 02 Mar 2017 13:03:41 -0500
changeset 345795 edf005cc0946
parent 345794 8e673e61fb8e
child 345796 5d85f0b3dea8
push id38290
push usercbook@mozilla.com
push dateFri, 03 Mar 2017 14:27:25 +0000
treeherderautoland@edf005cc0946 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersntim
bugs1312687
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1312687 - devtools-side-splitter now moves the correct direction in RTL locales r=ntim MozReview-Commit-ID: CpSZwZSstgX
devtools/client/shared/components/h-split-box.js
--- a/devtools/client/shared/components/h-split-box.js
+++ b/devtools/client/shared/components/h-split-box.js
@@ -102,17 +102,19 @@ module.exports = createClass({
   _onMouseMove(event) {
     if (!this.state.mouseDown) {
       return;
     }
 
     const rect = this.refs.box.getBoundingClientRect();
     const { left, right } = rect;
     const width = right - left;
-    const relative = event.clientX - left;
+    const direction = this.refs.box.ownerDocument.dir;
+    const relative = direction == "rtl" ? right - event.clientX
+                                        : event.clientX - left;
     this.props.onResize(relative / width);
 
     event.preventDefault();
   },
 
   render() {
     /* eslint-disable no-shadow */
     const { start, end, startWidth, minStartWidth, minEndWidth } = this.props;