Skip to content

Commit

Permalink
Merge branch 'tap-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
tilomitra committed Nov 8, 2012
2 parents baa1391 + 77192fc commit 34acb70
Show file tree
Hide file tree
Showing 15 changed files with 163 additions and 143 deletions.
21 changes: 14 additions & 7 deletions build/event-simulate/event-simulate-debug.js
Expand Up @@ -28,6 +28,14 @@ var L = Y.Lang,
contextmenu:1
},

msPointerEvents = {
MSPointerOver: 1,
MSPointerOut: 1,
MSPointerDown: 1,
MSPointerUp: 1,
MSPointerMove: 1,
},

//key events supported
keyEvents = {
keydown: 1,
Expand Down Expand Up @@ -324,21 +332,20 @@ function simulateMouseEvent(target /*:HTMLElement*/, type /*:String*/,
shiftKey /*:Boolean*/, metaKey /*:Boolean*/,
button /*:int*/, relatedTarget /*:HTMLElement*/) /*:Void*/
{

//check target
if (!target){
Y.error("simulateMouseEvent(): Invalid target.");
}

//check event type

if (isString(type)){
type = type.toLowerCase();

//make sure it's a supported mouse event
if (!mouseEvents[type]){
//make sure it's a supported mouse event or an msPointerEvent.
if (!mouseEvents[type.toLowerCase()] && !msPointerEvents[type]){
Y.error("simulateMouseEvent(): Event type '" + type + "' not supported.");
}
} else {
}
else {
Y.error("simulateMouseEvent(): Event type must be a string.");
}

Expand Down Expand Up @@ -896,7 +903,7 @@ Y.Event.simulate = function(target, type, options){

options = options || {};

if (mouseEvents[type]){
if (mouseEvents[type] || msPointerEvents[type]){
simulateMouseEvent(target, type, options.bubbles,
options.cancelable, options.view, options.detail, options.screenX,
options.screenY, options.clientX, options.clientY, options.ctrlKey,
Expand Down
2 changes: 1 addition & 1 deletion build/event-simulate/event-simulate-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 14 additions & 7 deletions build/event-simulate/event-simulate.js
Expand Up @@ -28,6 +28,14 @@ var L = Y.Lang,
contextmenu:1
},

msPointerEvents = {
MSPointerOver: 1,
MSPointerOut: 1,
MSPointerDown: 1,
MSPointerUp: 1,
MSPointerMove: 1,
},

//key events supported
keyEvents = {
keydown: 1,
Expand Down Expand Up @@ -324,21 +332,20 @@ function simulateMouseEvent(target /*:HTMLElement*/, type /*:String*/,
shiftKey /*:Boolean*/, metaKey /*:Boolean*/,
button /*:int*/, relatedTarget /*:HTMLElement*/) /*:Void*/
{

//check target
if (!target){
Y.error("simulateMouseEvent(): Invalid target.");
}

//check event type

if (isString(type)){
type = type.toLowerCase();

//make sure it's a supported mouse event
if (!mouseEvents[type]){
//make sure it's a supported mouse event or an msPointerEvent.
if (!mouseEvents[type.toLowerCase()] && !msPointerEvents[type]){
Y.error("simulateMouseEvent(): Event type '" + type + "' not supported.");
}
} else {
}
else {
Y.error("simulateMouseEvent(): Event type must be a string.");
}

Expand Down Expand Up @@ -896,7 +903,7 @@ Y.Event.simulate = function(target, type, options){

options = options || {};

if (mouseEvents[type]){
if (mouseEvents[type] || msPointerEvents[type]){
simulateMouseEvent(target, type, options.bubbles,
options.cancelable, options.view, options.detail, options.screenX,
options.screenY, options.clientX, options.clientY, options.ctrlKey,
Expand Down

0 comments on commit 34acb70

Please sign in to comment.