Skip to content

Commit

Permalink
moved bind, unbind, delegate & undelegate to event-alias.js; refs #13554
Browse files Browse the repository at this point in the history
  • Loading branch information
mgol authored and dmethvin committed Mar 26, 2013
1 parent 84a94ac commit 100d3c3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
23 changes: 20 additions & 3 deletions src/event-alias.js
Expand Up @@ -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 );
}
});
15 changes: 0 additions & 15 deletions src/event.js
Expand Up @@ -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 );
Expand Down

0 comments on commit 100d3c3

Please sign in to comment.