]> source.dussan.org Git - jquery.git/commitdiff
When .bind('unload') was called it accidentally went recursive, from 1bac61655b6c323a...
authorjeresig <jeresig@gmail.com>
Thu, 31 Dec 2009 05:49:53 +0000 (00:49 -0500)
committerjeresig <jeresig@gmail.com>
Thu, 31 Dec 2009 05:49:53 +0000 (00:49 -0500)
src/event.js

index 79a6b9529d4b88173afd03196c31b9ef72d39e0a..0bf7d90ba8a912693dfb11c7f0d728a4cd974ee0 100644 (file)
@@ -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 );
+                       });
        };
 });