Review code format fixes

This commit is contained in:
Ewa Gasperowicz
2018-09-18 07:26:51 +02:00
parent 9d7212bc1d
commit 76b34c62db

View File

@@ -89,8 +89,8 @@ export default class TwoUp extends HTMLElement {
// Set the initial position of the handle.
requestAnimationFrame(() => {
const bounds = this.getBoundingClientRect();
this._position = (this.orientation === 'vertical' ?
bounds.height : bounds.width) * this._relativePosition;
const dimensionAxis = this.orientation === 'vertical' ? 'height' : 'width';
this._position = bounds[dimensionAxis] * this._relativePosition;
this._setPosition();
});
}