Skip to content
Permalink
Browse files
Quick code optimization in trigger.
  • Loading branch information
jeresig committed Jan 22, 2007
1 parent 9141004 commit e45dbf29f88fb965c0abd039a65bc0302dea7e43
Showing with 5 additions and 7 deletions.
  1. +5 −7 src/event/event.js
@@ -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(){
jQuery.event.trigger( type, data, this );
});
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 }) );

0 comments on commit e45dbf2

Please sign in to comment.