Last active
January 15, 2018 04:27
-
-
Save yuheiy/e10b507442c865e889a926b9f1d5cde8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Hammer from 'hammerjs' | |
const hammer = new Hammer(backdropEl, { touchAction: 'auto' }) | |
hammer.get('pinch').set({ enable: true }) | |
let isPinching = false | |
hammer.on('pinchstart', () => { | |
isPinching = true | |
}) | |
hammer.on('pinchend', () => { | |
isPinching = false | |
}) | |
backdropEl.addEventListener('touchmove', (ev) => { | |
if (!isPinching) { | |
ev.preventDefault() | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment