Remove ugly workaround

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-02-24 19:33:17 +01:00
parent 81698a2714
commit 2021e4e345
No known key found for this signature in database
GPG Key ID: 9760693FDD98A790
1 changed files with 1 additions and 17 deletions

View File

@ -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">