Skip to content

Commit 80378a4

Browse files
authored
Merge pull request #31 from jdpaterson/master
fix gl3d hover on mobile and tablet devices
2 parents 7b09f1d + 8f96f03 commit 80378a4

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

camera.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -190,23 +190,17 @@ function createCamera(element, options) {
190190
var xy = mouseOffset(ev.changedTouches[0], element)
191191
handleInteraction(0, xy[0], xy[1], camera._lastMods)
192192
handleInteraction(1, xy[0], xy[1], camera._lastMods)
193-
194-
ev.preventDefault()
195-
}, hasPassive ? {passive: false} : false)
193+
}, hasPassive ? {passive: true} : false)
196194

197195
element.addEventListener('touchmove', function (ev) {
198196
var xy = mouseOffset(ev.changedTouches[0], element)
199197
handleInteraction(1, xy[0], xy[1], camera._lastMods)
200-
201198
ev.preventDefault()
202199
}, hasPassive ? {passive: false} : false)
203200

204201
element.addEventListener('touchend', function (ev) {
205-
206202
handleInteraction(0, camera._lastX, camera._lastY, camera._lastMods)
207-
208-
ev.preventDefault()
209-
}, hasPassive ? {passive: false} : false)
203+
}, hasPassive ? {passive: true} : false)
210204

211205
function handleInteraction (buttons, x, y, mods) {
212206
var keyBindingMode = camera.keyBindingMode

0 commit comments

Comments
 (0)