Skip to content

Commit

Permalink
fix #533
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminghe committed Dec 13, 2013
1 parent adc1404 commit fdd55f9
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 48 deletions.
54 changes: 27 additions & 27 deletions build/event/dom/touch-min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/event/dom/touch.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Copyright 2013, KISSY v1.41
MIT Licensed
build time: Dec 4 22:16
build time: Dec 13 19:28
*/
/*
Combined processedModules by KISSY Module Compiler:
Expand Down Expand Up @@ -60,7 +60,7 @@ KISSY.add("event/dom/touch/tap", ["./handle-map", "event/dom/base", "./single-to
var touch = e.changedTouches[0];
var target = e.target;
var eventObject = new DomEventObject({type:event, target:target, currentTarget:target});
S.mix(eventObject, {pageX:touch.pageX, pageY:touch.pageY, which:1, touch:touch});
S.mix(eventObject, {pageX:touch.pageX, pageY:touch.pageY, originalEvent:e.originalEvent, which:1, touch:touch});
DomEvent.fire(target, event, eventObject);
if(eventObject.isDefaultPrevented()) {
DomEvent.on(target, "click", {fn:preventDefault, once:1})
Expand Down Expand Up @@ -544,7 +544,7 @@ KISSY.add("event/dom/touch/handle", ["dom", "./handle-map", "event/dom/base", ".
if(isPointerEvent(type)) {
self.updateTouch(event.originalEvent)
}else {
if(!isTouchEvent()) {
if(!isTouchEvent(type)) {
throw new Error("unrecognized touch event: " + event.type);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ function visit41_255_1(result) {
function visit40_254_1(result) {
_$jscoverage['/touch/handle.js'].branchData['254'][1].ranCondition(result);
return result;
}_$jscoverage['/touch/handle.js'].branchData['244'][1].init(390, 15, '!isTouchEvent()');
}_$jscoverage['/touch/handle.js'].branchData['244'][1].init(390, 19, '!isTouchEvent(type)');
function visit39_244_1(result) {
_$jscoverage['/touch/handle.js'].branchData['244'][1].ranCondition(result);
return result;
Expand Down Expand Up @@ -1086,7 +1086,7 @@ KISSY.add(function(S, require) {
self.updateTouch(event.originalEvent);
} else {
_$jscoverage['/touch/handle.js'].lineData[244]++;
if (visit39_244_1(!isTouchEvent())) {
if (visit39_244_1(!isTouchEvent(type))) {
_$jscoverage['/touch/handle.js'].lineData[245]++;
throw new Error('unrecognized touch event: ' + event.type);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,11 @@ if (! _$jscoverage['/touch/tap.js']) {
_$jscoverage['/touch/tap.js'].lineData[40] = 0;
_$jscoverage['/touch/tap.js'].lineData[41] = 0;
_$jscoverage['/touch/tap.js'].lineData[46] = 0;
_$jscoverage['/touch/tap.js'].lineData[52] = 0;
_$jscoverage['/touch/tap.js'].lineData[53] = 0;
_$jscoverage['/touch/tap.js'].lineData[54] = 0;
_$jscoverage['/touch/tap.js'].lineData[62] = 0;
_$jscoverage['/touch/tap.js'].lineData[66] = 0;
_$jscoverage['/touch/tap.js'].lineData[55] = 0;
_$jscoverage['/touch/tap.js'].lineData[56] = 0;
_$jscoverage['/touch/tap.js'].lineData[64] = 0;
_$jscoverage['/touch/tap.js'].lineData[68] = 0;
}
if (! _$jscoverage['/touch/tap.js'].functionData) {
_$jscoverage['/touch/tap.js'].functionData = [];
Expand All @@ -273,12 +273,12 @@ if (! _$jscoverage['/touch/tap.js'].branchData) {
_$jscoverage['/touch/tap.js'].branchData['31'][2] = new BranchData();
_$jscoverage['/touch/tap.js'].branchData['32'] = [];
_$jscoverage['/touch/tap.js'].branchData['32'][1] = new BranchData();
_$jscoverage['/touch/tap.js'].branchData['53'] = [];
_$jscoverage['/touch/tap.js'].branchData['53'][1] = new BranchData();
_$jscoverage['/touch/tap.js'].branchData['55'] = [];
_$jscoverage['/touch/tap.js'].branchData['55'][1] = new BranchData();
}
_$jscoverage['/touch/tap.js'].branchData['53'][1].init(494, 32, 'eventObject.isDefaultPrevented()');
function visit110_53_1(result) {
_$jscoverage['/touch/tap.js'].branchData['53'][1].ranCondition(result);
_$jscoverage['/touch/tap.js'].branchData['55'][1].init(623, 32, 'eventObject.isDefaultPrevented()');
function visit110_55_1(result) {
_$jscoverage['/touch/tap.js'].branchData['55'][1].ranCondition(result);
return result;
}_$jscoverage['/touch/tap.js'].branchData['32'][1].init(82, 63, 'Math.abs(currentTouch.pageY - firstTouchXY.pageY) > sensitivity');
function visit109_32_1(result) {
Expand Down Expand Up @@ -354,21 +354,22 @@ KISSY.add(function(S, require) {
S.mix(eventObject, {
pageX: touch.pageX,
pageY: touch.pageY,
originalEvent: e.originalEvent,
which: 1,
touch: touch});
_$jscoverage['/touch/tap.js'].lineData[52]++;
_$jscoverage['/touch/tap.js'].lineData[54]++;
DomEvent.fire(target, event, eventObject);
_$jscoverage['/touch/tap.js'].lineData[53]++;
if (visit110_53_1(eventObject.isDefaultPrevented())) {
_$jscoverage['/touch/tap.js'].lineData[54]++;
_$jscoverage['/touch/tap.js'].lineData[55]++;
if (visit110_55_1(eventObject.isDefaultPrevented())) {
_$jscoverage['/touch/tap.js'].lineData[56]++;
DomEvent.on(target, 'click', {
fn: preventDefault,
once: 1});
}
}});
_$jscoverage['/touch/tap.js'].lineData[62]++;
_$jscoverage['/touch/tap.js'].lineData[64]++;
eventHandleMap[event] = {
handle: new Tap()};
_$jscoverage['/touch/tap.js'].lineData[66]++;
_$jscoverage['/touch/tap.js'].lineData[68]++;
return Tap;
});
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ KISSY.add(function (S, require) {
self.touches = [event.originalEvent];
} else if (isPointerEvent(type)) {
self.updateTouch(event.originalEvent);
} else if (!isTouchEvent()) {
} else if (!isTouchEvent(type)) {
throw new Error('unrecognized touch event: ' + event.type);
}
// no throttle! to allow preventDefault
Expand Down
2 changes: 2 additions & 0 deletions src/event/sub-modules/dom/sub-modules/touch/src/touch/tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ KISSY.add(function (S, require) {
S.mix(eventObject, {
pageX: touch.pageX,
pageY: touch.pageY,
// call e.preventDefault on tap event to prevent tap penetration
originalEvent: e.originalEvent,
which: 1,
touch: touch
});
Expand Down

0 comments on commit fdd55f9

Please sign in to comment.