diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2015-10-01 16:03:10 -0400 |
---|---|---|
committer | Oleg Gaidarenko <markelog@gmail.com> | 2015-10-12 17:32:08 +0300 |
commit | ee0854f85bd686b55757e8854a10480f23c928da (patch) | |
tree | 9c2096568d9deb7b72d2ae884fc0d0f3d6b5ce50 /src | |
parent | 9748e436ad80d6a2e1661ba4cf8d7391ed87c3ad (diff) | |
download | jquery-ee0854f85bd686b55757e8854a10480f23c928da.tar.gz jquery-ee0854f85bd686b55757e8854a10480f23c928da.zip |
Event: Move .bind() and .delegate() to deprecated
Fixes gh-2288
Closes gh-2624
Diffstat (limited to 'src')
-rw-r--r-- | src/deprecated.js | 22 | ||||
-rw-r--r-- | src/event/alias.js | 18 |
2 files changed, 22 insertions, 18 deletions
diff --git a/src/deprecated.js b/src/deprecated.js index dfb13e4ae..bc75f098a 100644 --- a/src/deprecated.js +++ b/src/deprecated.js @@ -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 ); + } +} ); + } ); diff --git a/src/event/alias.js b/src/event/alias.js index d2bdc5bb8..75467353c 100644 --- a/src/event/alias.js +++ b/src/event/alias.js @@ -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 ); } } ); |