blob: 863c94ad2e85e62b52f80fff665cb8a39743e5c1 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001define( [
2 "../core",
3
4 "../event",
5 "./trigger"
6], function( jQuery ) {
7
8"use strict";
9
10jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
11 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
12 "change select submit keydown keypress keyup contextmenu" ).split( " " ),
13 function( i, name ) {
14
15 // Handle event binding
16 jQuery.fn[ name ] = function( data, fn ) {
17 return arguments.length > 0 ?
18 this.on( name, null, data, fn ) :
19 this.trigger( name );
20 };
21} );
22
23jQuery.fn.extend( {
24 hover: function( fnOver, fnOut ) {
25 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
26 }
27} );
28
29} );