Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-37528 Libraries: Fix gesture + mouse issues with YUI

This addresses issues with devices which support both mouse and gesture
input devices whereby the presence of gesture support on the device causes
mouse interactions to be ignored.

This has the potential to cause issues with multiple events being triggered
for the same action, but we do not have this issue in core, and few
third-party plugins support drag and drop in such a way that this may be an
issue.

This is fixed in the latest version of YUI in a similar way, and the
addition of a new system to only trigger the event from the first action to
be triggered.
  • Loading branch information...
commit 75da763cd990ecfdbbf1a6f78b81898becf69a27 1 parent 22084d5
@andrewnicols andrewnicols authored
View
8 lib/yuilib/3.9.1/build/event-touch/event-touch-debug.js
@@ -140,10 +140,10 @@ if (Y.Node.DOM_EVENTS) {
//Add properties to Y.EVENT.GESTURE_MAP based on feature detection.
if ((win && ("ontouchstart" in win)) && !(Y.UA.chrome && Y.UA.chrome < 6)) {
- GESTURE_MAP.start = "touchstart";
- GESTURE_MAP.end = "touchend";
- GESTURE_MAP.move = "touchmove";
- GESTURE_MAP.cancel = "touchcancel";
+ GESTURE_MAP.start = ["touchstart", "mousedown"];
+ GESTURE_MAP.end = ["touchend", "mouseup"];
+ GESTURE_MAP.move = ["touchmove", "mousemove"];
+ GESTURE_MAP.cancel = ["touchcancel", "mousecancel"];
}
View
2  lib/yuilib/3.9.1/build/event-touch/event-touch-min.js
@@ -1,2 +1,2 @@
/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
-YUI.add("event-touch",function(e,t){var n="scale",r="rotation",i="identifier",s=e.config.win,o={};e.DOMEventFacade.prototype._touch=function(t,s,o){var u,a,f,l,c;if(t.touches){this.touches=[],c={};for(u=0,a=t.touches.length;u<a;++u)l=t.touches[u],c[e.stamp(l)]=this.touches[u]=new e.DOMEventFacade(l,s,o)}if(t.targetTouches){this.targetTouches=[];for(u=0,a=t.targetTouches.length;u<a;++u)l=t.targetTouches[u],f=c&&c[e.stamp(l,!0)],this.targetTouches[u]=f||new e.DOMEventFacade(l,s,o)}if(t.changedTouches){this.changedTouches=[];for(u=0,a=t.changedTouches.length;u<a;++u)l=t.changedTouches[u],f=c&&c[e.stamp(l,!0)],this.changedTouches[u]=f||new e.DOMEventFacade(l,s,o)}n in t&&(this[n]=t[n]),r in t&&(this[r]=t[r]),i in t&&(this[i]=t[i])},e.Node.DOM_EVENTS&&e.mix(e.Node.DOM_EVENTS,{touchstart:1,touchmove:1,touchend:1,touchcancel:1,gesturestart:1,gesturechange:1,gestureend:1,MSPointerDown:1,MSPointerUp:1,MSPointerMove:1}),s&&"ontouchstart"in s&&!(e.UA.chrome&&e.UA.chrome<6)?(o.start="touchstart",o.end="touchend",o.move="touchmove",o.cancel="touchcancel"):s&&"msPointerEnabled"in s.navigator?(o.start="MSPointerDown",o.end="MSPointerUp",o.move="MSPointerMove",o.cancel="MSPointerCancel"):(o.start="mousedown",o.end="mouseup",o.move="mousemove",o.cancel="mousecancel"),e.Event._GESTURE_MAP=o},"3.9.1",{requires:["node-base"]});
+YUI.add("event-touch",function(e,t){var n="scale",r="rotation",i="identifier",s=e.config.win,o={};e.DOMEventFacade.prototype._touch=function(t,s,o){var u,a,f,l,c;if(t.touches){this.touches=[],c={};for(u=0,a=t.touches.length;u<a;++u)l=t.touches[u],c[e.stamp(l)]=this.touches[u]=new e.DOMEventFacade(l,s,o)}if(t.targetTouches){this.targetTouches=[];for(u=0,a=t.targetTouches.length;u<a;++u)l=t.targetTouches[u],f=c&&c[e.stamp(l,!0)],this.targetTouches[u]=f||new e.DOMEventFacade(l,s,o)}if(t.changedTouches){this.changedTouches=[];for(u=0,a=t.changedTouches.length;u<a;++u)l=t.changedTouches[u],f=c&&c[e.stamp(l,!0)],this.changedTouches[u]=f||new e.DOMEventFacade(l,s,o)}n in t&&(this[n]=t[n]),r in t&&(this[r]=t[r]),i in t&&(this[i]=t[i])},e.Node.DOM_EVENTS&&e.mix(e.Node.DOM_EVENTS,{touchstart:1,touchmove:1,touchend:1,touchcancel:1,gesturestart:1,gesturechange:1,gestureend:1,MSPointerDown:1,MSPointerUp:1,MSPointerMove:1}),s&&"ontouchstart"in s&&!(e.UA.chrome&&e.UA.chrome<6)?(o.start=["touchstart","mousedown"],o.end=["touchend","mouseup"],o.move=["touchmove","mousemove"],o.cancel=["touchcancel","mousecancel"]):s&&"msPointerEnabled"in s.navigator?(o.start="MSPointerDown",o.end="MSPointerUp",o.move="MSPointerMove",o.cancel="MSPointerCancel"):(o.start="mousedown",o.end="mouseup",o.move="mousemove",o.cancel="mousecancel"),e.Event._GESTURE_MAP=o},"3.9.1",{requires:["node-base"]});
View
8 lib/yuilib/3.9.1/build/event-touch/event-touch.js
@@ -134,10 +134,10 @@ if (Y.Node.DOM_EVENTS) {
//Add properties to Y.EVENT.GESTURE_MAP based on feature detection.
if ((win && ("ontouchstart" in win)) && !(Y.UA.chrome && Y.UA.chrome < 6)) {
- GESTURE_MAP.start = "touchstart";
- GESTURE_MAP.end = "touchend";
- GESTURE_MAP.move = "touchmove";
- GESTURE_MAP.cancel = "touchcancel";
+ GESTURE_MAP.start = ["touchstart", "mousedown"];
+ GESTURE_MAP.end = ["touchend", "mouseup"];
+ GESTURE_MAP.move = ["touchmove", "mousemove"];
+ GESTURE_MAP.cancel = ["touchcancel", "mousecancel"];
}
Please sign in to comment.
Something went wrong with that request. Please try again.