diff options
Diffstat (limited to 'node_modules/jquery/src/event/alias.js')
-rw-r--r-- | node_modules/jquery/src/event/alias.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/node_modules/jquery/src/event/alias.js b/node_modules/jquery/src/event/alias.js new file mode 100644 index 0000000000..161c8935ef --- /dev/null +++ b/node_modules/jquery/src/event/alias.js @@ -0,0 +1,27 @@ +define( [ + "../core", + + "../event", + "./trigger" +], function( jQuery ) { + +jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error contextmenu" ).split( " " ), + function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + return arguments.length > 0 ? + this.on( name, null, data, fn ) : + this.trigger( name ); + }; +} ); + +jQuery.fn.extend( { + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +} ); + +} ); |