Quick code optimization in trigger.
This commit is contained in:
parent
9141004442
commit
e45dbf29f8
|
@ -74,15 +74,13 @@ jQuery.event = {
|
||||||
data = jQuery.makeArray(data || []);
|
data = jQuery.makeArray(data || []);
|
||||||
|
|
||||||
// Handle a global trigger
|
// Handle a global trigger
|
||||||
if ( !element ) {
|
if ( !element )
|
||||||
var g = this.global[type];
|
jQuery.each( this.global[type] || [], function(){
|
||||||
if ( g )
|
|
||||||
jQuery.each( g, function(){
|
|
||||||
jQuery.event.trigger( type, data, this );
|
jQuery.event.trigger( type, data, this );
|
||||||
});
|
});
|
||||||
|
|
||||||
// Handle triggering a single element
|
// Handle triggering a single element
|
||||||
} else if ( element["on" + type] ) {
|
else if ( element["on" + type] ) {
|
||||||
// Pass along a fake event
|
// Pass along a fake event
|
||||||
data.unshift( this.fix({ type: type, target: element }) );
|
data.unshift( this.fix({ type: type, target: element }) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue