From dcd3d059ad4ed5bb5f759c46c67327d09ae87581 Mon Sep 17 00:00:00 2001 From: Ada Rose Edwards Date: Mon, 18 Jul 2016 16:10:31 +0100 Subject: [PATCH] prevent default --- README.md | 1 + src/js/oCrossword.js | 5 +++++ src/scss/_base.scss | 8 ++------ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fd76286..d619496 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ * Toggle for changing side of preview bar * Note pad for +* Touch/scroll functionality did not work on iPhone # Testing Script diff --git a/src/js/oCrossword.js b/src/js/oCrossword.js index 3b0563f..e102c4e 100644 --- a/src/js/oCrossword.js +++ b/src/js/oCrossword.js @@ -545,6 +545,11 @@ OCrossword.prototype.assemble = function assemble() { this.hammerMC.on('panleft panright', onPanHoriz); this.hammerMC.on('panend pressup pancancel', onPanEnd); this.hammerMC.on('tap', onTap); + this.hammerMC.on('hammer.input', function (e) { + if (!cluesEl.contains(e.target) && !gridWrapper.contains(e.target)) { + e.preventDefault(); + } + }); this.addEventListener(this.rootEl, 'click', onPanEnd); diff --git a/src/scss/_base.scss b/src/scss/_base.scss index 50ac9c1..1639e6e 100644 --- a/src/scss/_base.scss +++ b/src/scss/_base.scss @@ -39,6 +39,7 @@ .o-crossword-grid-wrapper { flex-shrink: 0; overflow: auto; + -webkit-overflow-scrolling: touch; position: relative; font-size: 1.5em; @@ -239,6 +240,7 @@ } &.expanded { overflow-y: auto; + -webkit-overflow-scrolling: touch; height: 100%; max-height: 100%; background: white; @@ -281,9 +283,3 @@ } } } - -/// Add to crossword's wrapper element (if there is one) -@mixin oCrosswordWrapper { - overflow: auto; - width: 100%; -} \ No newline at end of file