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/deprecated.js | |
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/deprecated.js')
-rw-r--r-- | src/deprecated.js | 22 |
1 files changed, 22 insertions, 0 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 ); + } +} ); + } ); |