Bug 1312687 - devtools-side-splitter now moves the correct direction in RTL locales r?ntim
MozReview-Commit-ID: CpSZwZSstgX
--- 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;