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:
b9e0b6f
)
Added checks to triggerEvent for optional data and element verification. Uses $.apply...
author
John Resig
<jeresig@gmail.com>
Mon, 27 Mar 2006 07:09:28 +0000
(07:09 +0000)
committer
John Resig
<jeresig@gmail.com>
Mon, 27 Mar 2006 07:09:28 +0000
(07:09 +0000)
jquery/jquery.js
patch
|
blob
|
history
diff --git
a/jquery/jquery.js
b/jquery/jquery.js
index
48082c7
..
59b6779
100644
(file)
--- a/
jquery/jquery.js
+++ b/
jquery/jquery.js
@@
-697,9
+697,10
@@
function removeEvent(element, type, handler) {
}
};
-function triggerEvent(element,type) {
- if ( element["on" + type] )
- element["on" + type]({ type: type });
+function triggerEvent(element,type,data) {
+ data = data || [{ type: type }];
+ if ( element && element["on" + type] )
+ $.apply( element, element["on" + type], data );
}
function handleEvent(event) {