Remove ugly workaround
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
parent
81698a2714
commit
2021e4e345
|
@ -131,24 +131,18 @@ export default class ImageView extends React.Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
onRotateCounterClockwiseClick = (ev) => {
|
onRotateCounterClockwiseClick = (ev) => {
|
||||||
ev.preventDefault();
|
|
||||||
ev.stopPropagation();
|
|
||||||
const cur = this.state.rotation;
|
const cur = this.state.rotation;
|
||||||
const rotationDegrees = (cur - 90) % 360;
|
const rotationDegrees = (cur - 90) % 360;
|
||||||
this.setState({ rotation: rotationDegrees });
|
this.setState({ rotation: rotationDegrees });
|
||||||
};
|
};
|
||||||
|
|
||||||
onRotateClockwiseClick = (ev) => {
|
onRotateClockwiseClick = (ev) => {
|
||||||
ev.preventDefault();
|
|
||||||
ev.stopPropagation();
|
|
||||||
const cur = this.state.rotation;
|
const cur = this.state.rotation;
|
||||||
const rotationDegrees = (cur + 90) % 360;
|
const rotationDegrees = (cur + 90) % 360;
|
||||||
this.setState({ rotation: rotationDegrees });
|
this.setState({ rotation: rotationDegrees });
|
||||||
};
|
};
|
||||||
|
|
||||||
onZoomInClick = (ev) => {
|
onZoomInClick = (ev) => {
|
||||||
ev.preventDefault();
|
|
||||||
ev.stopPropagation();
|
|
||||||
if (this.state.zoom >= this.maxZoom) {
|
if (this.state.zoom >= this.maxZoom) {
|
||||||
this.setState({zoom: this.maxZoom});
|
this.setState({zoom: this.maxZoom});
|
||||||
return;
|
return;
|
||||||
|
@ -160,8 +154,6 @@ export default class ImageView extends React.Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
onZoomOutClick = (ev) => {
|
onZoomOutClick = (ev) => {
|
||||||
ev.preventDefault();
|
|
||||||
ev.stopPropagation();
|
|
||||||
if (this.state.zoom <= this.minZoom) {
|
if (this.state.zoom <= this.minZoom) {
|
||||||
this.setState({
|
this.setState({
|
||||||
zoom: this.minZoom,
|
zoom: this.minZoom,
|
||||||
|
@ -176,8 +168,6 @@ export default class ImageView extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onDownloadClick = (ev) => {
|
onDownloadClick = (ev) => {
|
||||||
ev.preventDefault();
|
|
||||||
ev.stopPropagation();
|
|
||||||
const a = document.createElement("a");
|
const a = document.createElement("a");
|
||||||
a.href = this.props.src;
|
a.href = this.props.src;
|
||||||
a.download = this.props.name;
|
a.download = this.props.name;
|
||||||
|
@ -185,8 +175,6 @@ export default class ImageView extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onOpenContextMenu = (ev) => {
|
onOpenContextMenu = (ev) => {
|
||||||
ev.preventDefault();
|
|
||||||
ev.stopPropagation();
|
|
||||||
this.setState({
|
this.setState({
|
||||||
contextMenuDisplay: true,
|
contextMenuDisplay: true,
|
||||||
});
|
});
|
||||||
|
@ -198,10 +186,6 @@ export default class ImageView extends React.Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onPanelClick = (ev) => {
|
|
||||||
this.props.onFinished();
|
|
||||||
}
|
|
||||||
|
|
||||||
onStartMoving = ev => {
|
onStartMoving = ev => {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
@ -324,7 +308,7 @@ export default class ImageView extends React.Component {
|
||||||
ref={ref => this.focusLock = ref}
|
ref={ref => this.focusLock = ref}
|
||||||
>
|
>
|
||||||
<div className="mx_ImageView_content">
|
<div className="mx_ImageView_content">
|
||||||
<div className="mx_ImageView_panel" onClick={this.onPanelClick}>
|
<div className="mx_ImageView_panel">
|
||||||
{info}
|
{info}
|
||||||
<div className="mx_ImageView_toolbar">
|
<div className="mx_ImageView_toolbar">
|
||||||
<div className="mx_ImageView_toolbar_buttons">
|
<div className="mx_ImageView_toolbar_buttons">
|
||||||
|
|
Loading…
Reference in New Issue