1
0
mirror of https://github.com/webslides/WebSlides.git synced 2025-09-03 10:02:58 +02:00

ESC key for zoom out

This commit is contained in:
Luis
2017-04-18 20:34:45 +02:00
parent 4dde8fe8fb
commit 95157d582a
4 changed files with 8 additions and 5 deletions

View File

@@ -50,7 +50,8 @@ export default class Zoom {
onKeyDown(event) {
if ( !this.isZoomed_ && Keys.MINUS.includes( event.which ) ) {
this.zoomIn();
} else if ( this.isZoomed_ && Keys.PLUS.includes( event.which ) ) {
} else if ( this.isZoomed_ &&
(Keys.PLUS.includes( event.which ) || event.which == Keys.ESCAPE ) ) {
this.zoomOut();
}
}

View File

@@ -10,7 +10,8 @@ const Keys = {
RIGHT: 39,
DOWN: 40,
PLUS: [107, 171],
MINUS: [109, 173]
MINUS: [109, 173],
ESCAPE: 27
};
export default Keys;