1
0
mirror of https://github.com/webslides/WebSlides.git synced 2025-08-18 19:02:00 +02:00

No autosliding if zoom gets enabled

This commit is contained in:
Antonio Laguna
2017-06-17 18:27:56 +02:00
parent 9256c476b9
commit 43bc612a5b
2 changed files with 14 additions and 2 deletions

View File

@@ -401,6 +401,11 @@ export default class WebSlides {
*/
disable() {
this.el.classList.add(CLASSES.DISABLED);
if (this.ws_.plugins.autoslide &&
this.plugins.autoslide.time !== false) {
this.plugins.autoslide.stop();
}
}
/**
@@ -408,6 +413,11 @@ export default class WebSlides {
*/
enable() {
this.el.classList.remove(CLASSES.DISABLED);
if (this.ws_.plugins.autoslide &&
this.ws_.plugins.autoslide.time !== false) {
this.ws_.plugins.autoslide.play();
}
}
/**

View File

@@ -49,10 +49,11 @@ export default class Zoom {
* @param {Event} event Key down event.
*/
onKeyDown(event) {
if (!this.isZoomed_ && Keys.MINUS.includes(event.which)) {
if (!this.isZoomed_ && Keys.MINUS.some(key => key === event.which)) {
this.zoomIn();
} else if (this.isZoomed_ &&
(Keys.PLUS.includes(event.which) || event.which === Keys.ESCAPE)) {
(Keys.PLUS.some(key => key === event.which) ||
event.which === Keys.ESCAPE)) {
this.zoomOut();
}
}
@@ -143,6 +144,7 @@ export default class Zoom {
this.zws_.el
.querySelector(`#zoomed-${currentId}`)
.classList.add(CLASSES.CURRENT);
setTimeout(() => {
this.ws_.disable();
}, 400);