Skip to content

Commit

Permalink
Prevent dragging of crop div. (mozilla-services#4456)
Browse files Browse the repository at this point in the history
- Also fix the width of right hand side background div.
  • Loading branch information
chenba committed May 15, 2018
1 parent 6323aba commit c85d792
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/src/pages/shot/crop-tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ exports.CropTool = class CropTool extends React.Component {
const selectionBottomPx = `${this.state.cropSelection.bottom}px`;
const selectionHeightPx = `${this.state.cropSelection.height}px`;
const selectionWidthPx = `${this.state.cropSelection.width}px`;
const remainingRightSideWidthPx = `${this.canvasWidth - this.state.cropSelection.right}px`;
const oneHundredPercent = "100%";

const bgTopStyles = {
Expand All @@ -83,7 +84,7 @@ exports.CropTool = class CropTool extends React.Component {
top: selectionTopPx,
height: selectionHeightPx,
left: selectionRightPx,
width: oneHundredPercent
width: remainingRightSideWidthPx
};
const bgBottomStyles = {
top: selectionBottomPx,
Expand Down Expand Up @@ -187,6 +188,7 @@ exports.CropTool = class CropTool extends React.Component {

isMousedown = true;
mousedownPosition = this.captureMousePosition(e);
e.preventDefault();

if (!this.state.cropSelection) {
this.setState({selectionState: SelectionState.CREATING});
Expand Down

0 comments on commit c85d792

Please sign in to comment.