Skip to content

Commit a29b4e1

Browse files
author
Weera Wu
committed
Ignore touchmove event
1 parent c736e37 commit a29b4e1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@
251251
style: {cursor: vnode.attrs.pointer ? 'default' : 'none'},
252252
onclick: vnode.attrs.onclick,
253253
ontouchstart: vnode.attrs.ontouchstart,
254+
ontouchmove: vnode.attrs.ontouchmove,
254255
ontouchend: vnode.attrs.ontouchend
255256
}, [
256257
m('#objects', [
@@ -281,13 +282,17 @@
281282
touch.pageX < pageCenter ? Direction.LEFT : Direction.RIGHT
282283
);
283284
},
285+
handleTouchmove: function(event) {
286+
event.preventDefault();
287+
state.clearTouch();
288+
},
284289
handleTouchend: function(event) {
285290
event.preventDefault();
286291
if (event.touches.length > 0) {
287292
return;
288293
}
289294
var time = state.touchTime();
290-
if (time > 1000) {
295+
if (time > 500) {
291296
state.nextTheme();
292297
} else if (time > 250) {
293298
} else if (state.touch.direction === Direction.LEFT) {
@@ -363,6 +368,7 @@
363368
theme: state.theme,
364369
onclick: this.handleClick.bind(this),
365370
ontouchstart: this.handleTouchstart.bind(this),
371+
ontouchmove: this.handleTouchmove.bind(this),
366372
ontouchend: this.handleTouchend.bind(this),
367373
oncontextmenu: this.handleContextmenu.bind(this),
368374
onkeydown: this.handleKeydown.bind(this)

0 commit comments

Comments
 (0)