Skip to content
Permalink
Browse files

Make sure that live focus and blur events also bind to the regular ev…

…ents, to handle triggered events. Fixes #6055.
  • Loading branch information
jeresig committed Feb 13, 2010
1 parent 467063a commit dd5c26304af1c5f884ebf0baa5df28a2f8a8c4cc
Showing with 17 additions and 2 deletions.
  1. +8 −1 src/event.js
  2. +9 −1 test/unit/event.js
@@ -956,7 +956,14 @@ jQuery.each(["live", "die"], function( i, name ) {
}

preType = type;
type = (liveMap[ type ] || type) + namespaces;

if ( type === "focus" || type === "blur" ) {
types.push( liveMap[ type ] + namespaces );
type = type + namespaces;

} else {
type = (liveMap[ type ] || type) + namespaces;
}

if ( name === "live" ) {
// bind live handler
@@ -759,7 +759,7 @@ test("toggle(Function, Function, ...)", function() {
});

test(".live()/.die()", function() {
expect(65);
expect(66);

var submit = 0, div = 0, livea = 0, liveb = 0;

@@ -1024,6 +1024,14 @@ test(".live()/.die()", function() {
equals( livee, 1, "Click, deep selector." );

jQuery("#nothiddendiv div").die("click");

jQuery("#nothiddendiv div").live("blur", function(){
ok( true, "Live div trigger blur." );
});

jQuery("#nothiddendiv div").trigger("blur");

jQuery("#nothiddendiv div").die("blur");
});

test("die all bound events", function(){

0 comments on commit dd5c263

Please sign in to comment.
You can’t perform that action at this time.