1
0
mirror of https://github.com/webslides/WebSlides.git synced 2025-08-16 18:14:09 +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;

View File

@@ -573,7 +573,8 @@ var Keys = {
RIGHT: 39,
DOWN: 40,
PLUS: [107, 171],
MINUS: [109, 173]
MINUS: [109, 173],
ESCAPE: 27
};
/* harmony default export */ __webpack_exports__["a"] = (Keys);
@@ -2567,7 +2568,7 @@ var Zoom = function () {
value: function onKeyDown(event) {
if (!this.isZoomed_ && __WEBPACK_IMPORTED_MODULE_1__utils_keys__["a" /* default */].MINUS.includes(event.which)) {
this.zoomIn();
} else if (this.isZoomed_ && __WEBPACK_IMPORTED_MODULE_1__utils_keys__["a" /* default */].PLUS.includes(event.which)) {
} else if (this.isZoomed_ && (__WEBPACK_IMPORTED_MODULE_1__utils_keys__["a" /* default */].PLUS.includes(event.which) || event.which == __WEBPACK_IMPORTED_MODULE_1__utils_keys__["a" /* default */].ESCAPE)) {
this.zoomOut();
}
}

File diff suppressed because one or more lines are too long