mirror of
https://github.com/webslides/WebSlides.git
synced 2025-08-18 10:51:28 +02:00
No autosliding if zoom gets enabled
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user