aboutsummaryrefslogtreecommitdiffstats
path: root/src/deprecated.js
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2015-10-01 16:03:10 -0400
committerOleg Gaidarenko <markelog@gmail.com>2015-10-12 17:34:20 +0300
commit7e78c2ec81dbb7bac9222864c4981ed0a54b66e5 (patch)
treedf28986985437b923471a7999792a350529dbdaa /src/deprecated.js
parent15f79201c40fda064d184392da33b88a727720da (diff)
downloadjquery-7e78c2ec81dbb7bac9222864c4981ed0a54b66e5.tar.gz
jquery-7e78c2ec81dbb7bac9222864c4981ed0a54b66e5.zip
Event: Move .bind() and .delegate() to deprecated
Cherry-picked from ee0854f85bd686b55757e8854a10480f23c928da Fixes gh-2288 Closes gh-2624
Diffstat (limited to 'src/deprecated.js')
-rw-r--r--src/deprecated.js22
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 );
+ }
+} );
+
} );