- var val, ret, fn = jQuery.isFunction( elem[ type ] || null ),
- // Check to see if we need to provide a fake event, or not
- event = !data[0] || !data[0].preventDefault;
-
- // Pass along a fake event
- if ( event ) {
- data.unshift({
- type: type,
- target: elem,
- preventDefault: function(){},
- stopPropagation: function(){},
- stopImmediatePropagation:stopImmediatePropagation,
- timeStamp: now()
- });
- data[0][expando] = true; // no need to fix fake event
- }
-
- // Enforce the right trigger type
- data[0].type = type;
- if ( exclusive )
- data[0].exclusive = true;
-
- if ( dohandlers !== false ) {
- // Trigger the event, it is assumed that "handle" is a function
- var handle = jQuery.data(elem, "handle");
- if ( handle )
- val = handle.apply( elem, data );