summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lightbox.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lightbox.js b/src/lightbox.js
index 2bd242b..bef29eb 100644
--- a/src/lightbox.js
+++ b/src/lightbox.js
@@ -41,14 +41,12 @@ export default class LightBox {
initControls() {
// keyboard shortcuts
document.addEventListener('keydown', e => {
- if (e.key === 'Escape' || e.key === ' ') {
+ if (e.key === 'Escape' || e.key === ' ')
this.closeCurrent();
- }
});
// scroll to dismiss
- document.body.addEventListener('wheel', e => {
- this.closeCurrent();
- });
+ document.body.addEventListener('wheel', e => this.closeCurrent());
+ document.body.addEventListener('touchmove', e => this.closeCurrent());
}
/**