Quick code optimization in trigger.

This commit is contained in:
John Resig 2007-01-22 00:38:57 +00:00
parent 9141004442
commit e45dbf29f8

View file

@ -74,15 +74,13 @@ jQuery.event = {
data = jQuery.makeArray(data || []);
// Handle a global trigger
if ( !element ) {
var g = this.global[type];
if ( g )
jQuery.each( g, function(){
if ( !element )
jQuery.each( this.global[type] || [], function(){
jQuery.event.trigger( type, data, this );
});
// Handle triggering a single element
} else if ( element["on" + type] ) {
else if ( element["on" + type] ) {
// Pass along a fake event
data.unshift( this.fix({ type: type, target: element }) );