Event: Move .bind() and .delegate() to deprecated

Fixes gh-2288
Closes gh-2624
This commit is contained in:
Dave Methvin
2015-10-01 16:03:10 -04:00
committed by Oleg Gaidarenko
parent 9748e436ad
commit ee0854f85b
4 changed files with 63 additions and 18 deletions

View File

@@ -1,2 +1,24 @@
define( function() {
jQuery.fn.extend( {
bind: function( types, data, fn ) {
return this.on( types, null, data, fn );
},
unbind: function( types, fn ) {
return this.off( types, null, fn );
},
delegate: function( selector, types, data, fn ) {
return this.on( types, selector, data, fn );
},
undelegate: function( selector, types, fn ) {
// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ?
this.off( selector, "**" ) :
this.off( types, selector || "**", fn );
}
} );
} );

View File

@@ -19,24 +19,6 @@ jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
jQuery.fn.extend( {
hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
},
bind: function( types, data, fn ) {
return this.on( types, null, data, fn );
},
unbind: function( types, fn ) {
return this.off( types, null, fn );
},
delegate: function( selector, types, data, fn ) {
return this.on( types, selector, data, fn );
},
undelegate: function( selector, types, fn ) {
// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ?
this.off( selector, "**" ) :
this.off( types, selector || "**", fn );
}
} );