aboutsummaryrefslogtreecommitdiffstats
path: root/src/event
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2007-01-22 00:38:57 +0000
committerJohn Resig <jeresig@gmail.com>2007-01-22 00:38:57 +0000
commite45dbf29f88fb965c0abd039a65bc0302dea7e43 (patch)
treefaf0628aa80c240bbdfb7a2a3ccde51ec25a89f7 /src/event
parent91410044426439983f409d198b8f9af2c5151d95 (diff)
downloadjquery-e45dbf29f88fb965c0abd039a65bc0302dea7e43.tar.gz
jquery-e45dbf29f88fb965c0abd039a65bc0302dea7e43.zip
Quick code optimization in trigger.
Diffstat (limited to 'src/event')
-rw-r--r--src/event/event.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/event/event.js b/src/event/event.js
index 88bbbda2b..812b8923d 100644
--- a/src/event/event.js
+++ b/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 }) );