]> git.openstreetmap.org Git - rails.git/blobdiff - vendor/assets/jquery/jquery.simulate.js
Update to iD v1.7.3
[rails.git] / vendor / assets / jquery / jquery.simulate.js
index 1dd96ac3a7dc6d0a8d920dc5a1907f4c8e6e005e..4a96cc310615b44ff70414974bbd3b99ea5dbadb 100644 (file)
@@ -1,12 +1,12 @@
  /*!
- * jQuery Simulate v0.0.1 - simulate browser mouse and keyboard events
+ * jQuery Simulate v1.0.0 - simulate browser mouse and keyboard events
  * https://github.com/jquery/jquery-simulate
  *
  * Copyright 2012 jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  *
- * Date: Sun Dec 9 12:15:33 2012 -0500
+ * Date: 2014-08-22
  */
 
 ;(function( $, undefined ) {
@@ -144,7 +144,7 @@ $.extend( $.simulate.prototype, {
                                0: 1,
                                1: 4,
                                2: 2
-                       }[ event.button ] || event.button;
+                       }[ event.button ] || ( event.button === -1 ? 0 : event.button );
                }
 
                return event;
@@ -201,7 +201,9 @@ $.extend( $.simulate.prototype, {
        },
 
        dispatchEvent: function( elem, type, event ) {
-               if ( elem.dispatchEvent ) {
+               if ( elem[ type ] ) {
+                       elem[ type ]();
+               } else if ( elem.dispatchEvent ) {
                        elem.dispatchEvent( event );
                } else if ( elem.fireEvent ) {
                        elem.fireEvent( "on" + type, event );