Skip to content

Commit be25643

Browse files
authored
Update index.html
1 parent 0e9936a commit be25643

File tree

1 file changed

+4
-27
lines changed

1 file changed

+4
-27
lines changed

docs/index.html

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -104,36 +104,13 @@
104104

105105
var filename = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
106106

107-
function touchHandler(event)
108-
{
109-
var touches = event.changedTouches,
110-
first = touches[0],
111-
type = "";
112-
switch(event.type)
113-
{
114-
case "touchstart": type = "mousedown"; break;
115-
case "touchmove": type = "mousemove"; break;
116-
case "touchend": type = "mouseup"; break;
117-
default: return;
118-
}
119107

120-
var simulatedEvent = document.createEvent("MouseEvent");
121-
simulatedEvent.initMouseEvent(type, true, true, window, 1,
122-
first.screenX, first.screenY,
123-
first.clientX, first.clientY, false,
124-
false, false, false, 0/*left*/, null);
125-
126-
first.target.dispatchEvent(simulatedEvent);
127-
}
128108

129109
init();
130110

131111
function init() {
132112
canvas = document.getElementById('drawingCanvas');
133-
document.addEventListener("touchstart", touchHandler, true);
134-
document.addEventListener("touchmove", touchHandler, true);
135-
document.addEventListener("touchend", touchHandler, true);
136-
document.addEventListener("touchcancel", touchHandler, true);
113+
137114
ctx = canvas.getContext("2d");
138115
w = canvas.width;
139116
h = canvas.height;
@@ -152,11 +129,11 @@
152129
}, false);
153130

154131
canvas.addEventListener("touchmove", function (e) {
155-
touchHandler, true);
132+
findxy('out', e.touches[0]), false);
156133
canvas.addEventListener("touchstart", function (e) {
157-
touchHandler, true);
134+
findxy('out', e.touches[0]), false);
158135
canvas.addEventListener("touchend", function (e) {
159-
touchHandler, true);
136+
findxy('out', e.touches[0]), false);
160137
}
161138

162139
function draw() {

0 commit comments

Comments
 (0)