Skip to content

Commit a57a9c3

Browse files
committed
Comment explaining a seemingly random mapping for event.button in oldIE
1 parent 73e28be commit a57a9c3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jquery.simulate.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ $.extend( $.simulate.prototype, {
103103
} else if ( document.createEventObject ) {
104104
event = document.createEventObject();
105105
$.extend( event, options );
106-
// TODO: what is this mapping for?
106+
// standards event.button uses constants defined here: http://msdn.microsoft.com/en-us/library/ie/ff974877(v=vs.85).aspx
107+
// old IE event.button uses constants defined here: http://msdn.microsoft.com/en-us/library/ie/ms533544(v=vs.85).aspx
108+
// so we actually need to map the standard back to oldIE
107109
event.button = { 0:1, 1:4, 2:2 }[ event.button ] || event.button;
108110
}
109111

0 commit comments

Comments
 (0)