mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-16 19:05:23 +03:00
Remove the need to press ctrl while zooming
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
776b0e8198
commit
f0abd52130
1 changed files with 11 additions and 13 deletions
|
@ -79,23 +79,21 @@ export default class ImageView extends React.Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
onWheel = (ev) => {
|
onWheel = (ev) => {
|
||||||
if (ev.ctrlKey) {
|
ev.stopPropagation();
|
||||||
ev.stopPropagation();
|
ev.preventDefault();
|
||||||
ev.preventDefault();
|
const newZoom =this.state.zoom - ev.deltaY;
|
||||||
const newZoom =this.state.zoom - ev.deltaY;
|
|
||||||
|
|
||||||
if (newZoom <= 100) {
|
if (newZoom <= 100) {
|
||||||
this.setState({
|
|
||||||
zoom: 100,
|
|
||||||
translationX: 0,
|
|
||||||
translationY: 0,
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.setState({
|
this.setState({
|
||||||
zoom: newZoom,
|
zoom: 100,
|
||||||
|
translationX: 0,
|
||||||
|
translationY: 0,
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
this.setState({
|
||||||
|
zoom: newZoom,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onRedactClick = () => {
|
onRedactClick = () => {
|
||||||
|
|
Loading…
Reference in a new issue