src/event/alias.js

Maintainability

83.74

Lines of code

29

Created with Raphaël 2.1.002550751002016-7-102016-6-102016-5-112016-4-112016-3-122016-2-112016-1-12

2016-8-9
Maintainability: 83.74

Created with Raphaël 2.1.007.51522.5302016-7-102016-6-102016-5-112016-4-112016-3-122016-2-112016-1-12

2016-8-9
Lines of Code: 29

Difficulty

9.60

Estimated Errors

0.15

Function weight

By Complexity

Created with Raphaël 2.1.0<anonymous>2

By SLOC

Created with Raphaël 2.1.0<anonymous>24
1
define( [
2
    "../core",
3
 
4
    "../event",
5
    "./trigger"
6
], function( jQuery ) {
7
 
8
"use strict";
9
 
10
jQuery.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
 
23
jQuery.fn.extend( {
24
    hover: function( fnOver, fnOut ) {
25
        return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
26
    }
27
} );
28
 
29
} );