Merge branch 'bug-5735'
[jquery.git] / src / event.js
index 6f8989a..64b202d 100644 (file)
@@ -427,7 +427,7 @@ jQuery.event = {
                ready: {
                        // Make sure the ready event is setup
                        setup: jQuery.bindReady,
-                       teardown: function() {}
+                       teardown: jQuery.noop
                },
 
                live: {
@@ -691,7 +691,7 @@ jQuery.event.special.change = {
                },
 
                // Change has to be called before submit
-               // Keydown will be called before keypress, wich is used in submit-event delegation
+               // Keydown will be called before keypress, which is used in submit-event delegation
                keydown: function( e ) {
                        var elem = e.target, type = elem.type;
 
@@ -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 );
+                       });
        };
 });