aboutsummaryrefslogtreecommitdiffstats
path: root/src/event.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2009-12-31 00:49:53 -0500
committerjeresig <jeresig@gmail.com>2009-12-31 00:49:53 -0500
commitea5d51400820585a6d31011e1a1109c5a1213360 (patch)
tree918078337fa212bea34f018bfddf57e7782b87ef /src/event.js
parenta00e63ea5a2c26f8e6384b5d1e2247be44c727e9 (diff)
downloadjquery-ea5d51400820585a6d31011e1a1109c5a1213360.tar.gz
jquery-ea5d51400820585a6d31011e1a1109c5a1213360.zip
When .bind('unload') was called it accidentally went recursive, from 1bac61655b6c323ab4bcfc65b0d95c1587dd8503. Fixes #5688.
Diffstat (limited to 'src/event.js')
-rw-r--r--src/event.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/event.js b/src/event.js
index 79a6b9529..0bf7d90ba 100644
--- a/src/event.js
+++ b/src/event.js
@@ -778,9 +778,11 @@ jQuery.each(["bind", "one"], function( i, name ) {
jQuery( this ).unbind( event, handler );
return fn.apply( this, arguments );
}) : fn;
- return type === "unload" ? this.one(type, data, handler, thisObject) : this.each(function() {
- jQuery.event.add( this, type, handler, data );
- });
+ return type === "unload" && name !== "one" ?
+ this.one( type, data, fn, thisObject ) :
+ this.each(function() {
+ jQuery.event.add( this, type, handler, data );
+ });
};
});