Fix bug
This commit is contained in:
parent
b8628b5ff9
commit
bc791cf681
@ -842,8 +842,13 @@ events.prototype.doEvent = function (data, x, y, prefix) {
|
||||
|
||||
events.prototype.setEvents = function (list, x, y, callback) {
|
||||
var data = core.status.event.data || {};
|
||||
if (list)
|
||||
if (list) {
|
||||
data.list = [{todo: core.clone(list), total: core.clone(list), condition: "false"}];
|
||||
// 结束所有正在执行的自动事件
|
||||
core.status.autoEvents.forEach(function (autoEvent) {
|
||||
core.autoEventExecuting(autoEvent.symbol, null);
|
||||
});
|
||||
}
|
||||
if (x != null) data.x = x;
|
||||
if (y != null) data.y = y;
|
||||
if (callback) data.callback = callback;
|
||||
|
||||
7
main.js
7
main.js
@ -489,6 +489,7 @@ main.dom.data.ontouchstart = function (e) {
|
||||
e.preventDefault();
|
||||
var loc = main.core.actions._getClickLoc(e.targetTouches[0].clientX, e.targetTouches[0].clientY);
|
||||
if (loc == null) return;
|
||||
main.lastTouchLoc = loc;
|
||||
main.core.ondown(loc);
|
||||
}catch (ee) { main.log(ee); }
|
||||
}
|
||||
@ -499,6 +500,7 @@ main.dom.data.ontouchmove = function (e) {
|
||||
e.preventDefault();
|
||||
var loc = main.core.actions._getClickLoc(e.targetTouches[0].clientX, e.targetTouches[0].clientY);
|
||||
if (loc == null) return;
|
||||
main.lastTouchLoc = loc;
|
||||
main.core.onmove(loc);
|
||||
}catch (ee) { main.log(ee); }
|
||||
}
|
||||
@ -507,8 +509,9 @@ main.dom.data.ontouchmove = function (e) {
|
||||
main.dom.data.ontouchend = function (e) {
|
||||
try {
|
||||
e.preventDefault();
|
||||
var loc = main.core.actions._getClickLoc(e.targetTouches[0].clientX, e.targetTouches[0].clientY);
|
||||
if (loc == null) return;
|
||||
if (main.lastTouchLoc == null) return;
|
||||
var loc = main.lastTouchLoc;
|
||||
delete main.lastTouchLoc;
|
||||
main.core.onup(loc);
|
||||
} catch (e) {
|
||||
main.log(e);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user