mirror of
https://github.com/webslides/WebSlides.git
synced 2025-08-20 11:51:40 +02:00
No autosliding if zoom gets enabled
This commit is contained in:
@@ -401,6 +401,11 @@ export default class WebSlides {
|
|||||||
*/
|
*/
|
||||||
disable() {
|
disable() {
|
||||||
this.el.classList.add(CLASSES.DISABLED);
|
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() {
|
enable() {
|
||||||
this.el.classList.remove(CLASSES.DISABLED);
|
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.
|
* @param {Event} event Key down event.
|
||||||
*/
|
*/
|
||||||
onKeyDown(event) {
|
onKeyDown(event) {
|
||||||
if (!this.isZoomed_ && Keys.MINUS.includes(event.which)) {
|
if (!this.isZoomed_ && Keys.MINUS.some(key => key === event.which)) {
|
||||||
this.zoomIn();
|
this.zoomIn();
|
||||||
} else if (this.isZoomed_ &&
|
} 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();
|
this.zoomOut();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -143,6 +144,7 @@ export default class Zoom {
|
|||||||
this.zws_.el
|
this.zws_.el
|
||||||
.querySelector(`#zoomed-${currentId}`)
|
.querySelector(`#zoomed-${currentId}`)
|
||||||
.classList.add(CLASSES.CURRENT);
|
.classList.add(CLASSES.CURRENT);
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.ws_.disable();
|
this.ws_.disable();
|
||||||
}, 400);
|
}, 400);
|
||||||
|
Reference in New Issue
Block a user