From 100d3c351604e1f9641098da2e78678b4e6d9cdf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20Go=C5=82=C4=99biowski?= Date: Mon, 4 Mar 2013 04:03:57 +0100 Subject: [PATCH] moved bind, unbind, delegate & undelegate to event-alias.js; refs #13554 --- src/event-alias.js | 23 ++++++++++++++++++++--- src/event.js | 15 --------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/event-alias.js b/src/event-alias.js index 0a87c5965..b1a15e840 100644 --- a/src/event-alias.js +++ b/src/event-alias.js @@ -10,6 +10,23 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl }; }); -jQuery.fn.hover = function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); -}; +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 ); + } +}); diff --git a/src/event.js b/src/event.js index d784e1c66..4804e5a7d 100644 --- a/src/event.js +++ b/src/event.js @@ -800,21 +800,6 @@ 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 ); - }, - trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); -- 2.39.5