scratch – Blame information for rev 127
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
125 | office | 1 | define([ |
58 | office | 2 | "../core", |
125 | office | 3 | "../event" |
58 | office | 4 | ], function( jQuery ) { |
5 | |||
125 | office | 6 | jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + |
58 | office | 7 | "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + |
125 | office | 8 | "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { |
58 | office | 9 | |
10 | // Handle event binding |
||
11 | jQuery.fn[ name ] = function( data, fn ) { |
||
12 | return arguments.length > 0 ? |
||
13 | this.on( name, null, data, fn ) : |
||
14 | this.trigger( name ); |
||
15 | }; |
||
125 | office | 16 | }); |
58 | office | 17 | |
125 | office | 18 | jQuery.fn.extend({ |
58 | office | 19 | hover: function( fnOver, fnOut ) { |
20 | return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); |
||
125 | office | 21 | }, |
22 | |||
23 | bind: function( types, data, fn ) { |
||
24 | return this.on( types, null, data, fn ); |
||
25 | }, |
||
26 | unbind: function( types, fn ) { |
||
27 | return this.off( types, null, fn ); |
||
28 | }, |
||
29 | |||
30 | delegate: function( selector, types, data, fn ) { |
||
31 | return this.on( types, selector, data, fn ); |
||
32 | }, |
||
33 | undelegate: function( selector, types, fn ) { |
||
34 | // ( namespace ) or ( selector, types [, fn] ) |
||
35 | return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); |
||
58 | office | 36 | } |
125 | office | 37 | }); |
58 | office | 38 | |
125 | office | 39 | }); |