mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Made sure that $.event.handle() always has some form of an event object.
This commit is contained in:
parent
c75701a015
commit
81fda970ff
7
jquery/jquery.js
vendored
7
jquery/jquery.js
vendored
@ -781,12 +781,15 @@ $.event.trigger = function(element,type,data) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$.event.handle = function(event) {
|
$.event.handle = function(event) {
|
||||||
var returnValue = true;
|
if ( !event && !window.event ) { return null; }
|
||||||
|
|
||||||
|
var returnValue = true, handlers = [];
|
||||||
event = event || $.event.fix(window.event);
|
event = event || $.event.fix(window.event);
|
||||||
var handlers = [];
|
|
||||||
for ( var j in this.events[event.type] ) {
|
for ( var j in this.events[event.type] ) {
|
||||||
handlers[handlers.length] = this.events[event.type][j];
|
handlers[handlers.length] = this.events[event.type][j];
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( var i = 0; i < handlers.length; i++ ) {
|
for ( var i = 0; i < handlers.length; i++ ) {
|
||||||
try {
|
try {
|
||||||
if ( handlers[i].constructor == Function ) {
|
if ( handlers[i].constructor == Function ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user