git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
467063a
)
Make sure that live focus and blur events also bind to the regular events, to handle...
author
jeresig
<jeresig@gmail.com>
Sat, 13 Feb 2010 10:37:17 +0000
(
05:37
-0500)
committer
jeresig
<jeresig@gmail.com>
Sat, 13 Feb 2010 10:37:17 +0000
(
05:37
-0500)
src/event.js
patch
|
blob
|
history
test/unit/event.js
patch
|
blob
|
history
diff --git
a/src/event.js
b/src/event.js
index
c6a953b
..
d59533f
100644
(file)
--- a/
src/event.js
+++ b/
src/event.js
@@
-956,7
+956,14
@@
jQuery.each(["live", "die"], function( i, name ) {
}
preType = type;
}
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
if ( name === "live" ) {
// bind live handler
diff --git
a/test/unit/event.js
b/test/unit/event.js
index
33329c3
..
21167c7
100644
(file)
--- a/
test/unit/event.js
+++ b/
test/unit/event.js
@@
-759,7
+759,7
@@
test("toggle(Function, Function, ...)", function() {
});
test(".live()/.die()", function() {
});
test(".live()/.die()", function() {
- expect(65);
+ expect(66);
var submit = 0, div = 0, livea = 0, liveb = 0;
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");
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(){
});
test("die all bound events", function(){