Bug 1312687 - devtools-side-splitter now moves the correct direction in RTL locales r?ntim draft
authorNick <nick@foxsec.io>
Thu, 02 Mar 2017 13:03:41 -0500
changeset 493010 618d0e46047cb3ab02349f704efdcabc7c9ae817
parent 491665 e91de6fb2b3dce9c932428265b0fdb630ea470d7
child 493011 fec75317497e9bcfa76b2ca69ec456d665ce8407
child 493013 49a991d8ef9eaaf9bdc6a0630d2a29a4282fbb60
push id47623
push usernick@foxsec.io
push dateFri, 03 Mar 2017 04:43:44 +0000
reviewersntim
bugs1312687
milestone54.0a1
Bug 1312687 - devtools-side-splitter now moves the correct direction in RTL locales r?ntim MozReview-Commit-ID: JhzZjqhpZpb
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;