scratch – Diff between revs 58 and 125
?pathlinks?
Rev 58 | Rev 125 | |||
---|---|---|---|---|
Line 1... | Line 1... | |||
1 | define( [ |
1 | define([ |
|
2 | "../core", |
2 | "../core", |
|
3 | |
- | ||
4 | "../event", |
3 | "../event" |
|
5 | "./trigger" |
- | ||
6 | ], function( jQuery ) { |
4 | ], function( jQuery ) { |
|
Line 7... | Line -... | |||
7 | |
- | ||
8 | "use strict"; |
- | ||
9 | |
5 | |
|
10 | jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + |
6 | jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + |
|
11 | "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + |
7 | "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + |
|
12 | "change select submit keydown keypress keyup contextmenu" ).split( " " ), |
- | ||
Line 13... | Line 8... | |||
13 | function( i, name ) { |
8 | "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { |
|
14 | |
9 | |
|
15 | // Handle event binding |
10 | // Handle event binding |
|
16 | jQuery.fn[ name ] = function( data, fn ) { |
11 | jQuery.fn[ name ] = function( data, fn ) { |
|
17 | return arguments.length > 0 ? |
12 | return arguments.length > 0 ? |
|
18 | this.on( name, null, data, fn ) : |
13 | this.on( name, null, data, fn ) : |
|
19 | this.trigger( name ); |
14 | this.trigger( name ); |
|
Line 20... | Line 15... | |||
20 | }; |
15 | }; |
|
21 | } ); |
16 | }); |
|
22 | |
17 | |
|
- | 18 | jQuery.fn.extend({ |
||
- | 19 | hover: function( fnOver, fnOut ) { |
||
- | 20 | return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); |
||
- | 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 | }, |
||
23 | jQuery.fn.extend( { |
33 | undelegate: function( selector, types, fn ) { |
|
24 | hover: function( fnOver, fnOut ) { |
34 | // ( namespace ) or ( selector, types [, fn] ) |
|
Line 25... | Line 35... | |||
25 | return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); |
35 | return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); |