mirror of https://github.com/luileito/jsketch.git
Include event type
This commit is contained in:
parent
5fab1d0cf7
commit
f182258713
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -665,15 +665,25 @@
|
||||||
var touches = e.originalEvent.changedTouches;
|
var touches = e.originalEvent.changedTouches;
|
||||||
for (var i = 0; i < touches.length; i++) {
|
for (var i = 0; i < touches.length; i++) {
|
||||||
var touch = touches[i];
|
var touch = touches[i];
|
||||||
|
evtProps(touch, e.originalEvent);
|
||||||
callback(touch);
|
callback(touch);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Track only the current finger.
|
// Track only the current finger.
|
||||||
var touch = e.originalEvent.touches[0];
|
var touch = e.originalEvent.touches[0];
|
||||||
|
evtProps(touch, e.originalEvent);
|
||||||
callback(touch);
|
callback(touch);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ignore
|
||||||
|
*/
|
||||||
|
function evtProps(targetEvent, sourceEvent) {
|
||||||
|
// TODO: Ensure all desired properties are included in the target event.
|
||||||
|
if (!targetEvent.type) targetEvent.type = sourceEvent.type;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redraw canvas according to stored strokes data.
|
* Redraw canvas according to stored strokes data.
|
||||||
* @return {object} jQuery
|
* @return {object} jQuery
|
||||||
|
|
|
||||||
|
|
@ -661,16 +661,26 @@
|
||||||
var touches = e.changedTouches;
|
var touches = e.changedTouches;
|
||||||
for (var i = 0; i < touches.length; i++) {
|
for (var i = 0; i < touches.length; i++) {
|
||||||
var touch = touches[i];
|
var touch = touches[i];
|
||||||
|
evtProps(touch, e);
|
||||||
callback(touch);
|
callback(touch);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Track only the current finger.
|
// Track only the current finger.
|
||||||
var touch = e.touches[0];
|
var touch = e.touches[0];
|
||||||
|
evtProps(touch, e);
|
||||||
callback(touch);
|
callback(touch);
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ignore
|
||||||
|
*/
|
||||||
|
function evtProps(targetEvent, sourceEvent) {
|
||||||
|
// TODO: Ensure all desired properties are included in the target event.
|
||||||
|
if (!targetEvent.type) targetEvent.type = sourceEvent.type;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue