mirror of
https://github.com/jquery/jquery.git
synced 2024-12-09 08:04:24 +00:00
Added checks to triggerEvent for optional data and element verification. Uses $.apply() now, too.
This commit is contained in:
parent
b9e0b6ff37
commit
11e82e95b6
7
jquery/jquery.js
vendored
7
jquery/jquery.js
vendored
@ -697,9 +697,10 @@ function removeEvent(element, type, handler) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function triggerEvent(element,type) {
|
function triggerEvent(element,type,data) {
|
||||||
if ( element["on" + type] )
|
data = data || [{ type: type }];
|
||||||
element["on" + type]({ type: type });
|
if ( element && element["on" + type] )
|
||||||
|
$.apply( element, element["on" + type], data );
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleEvent(event) {
|
function handleEvent(event) {
|
||||||
|
Loading…
Reference in New Issue
Block a user