Skip to content
Permalink
Browse files

Widget: Don't use $.event.props when creating events.

  • Loading branch information
scottgonzalez committed Nov 21, 2011
1 parent 93214d6 commit 91ef69d7503f11f2b6223b9c0061fca51e3a006f
Showing with 12 additions and 13 deletions.
  1. +12 −13 ui/jquery.ui.widget.js
@@ -374,29 +374,28 @@ $.Widget.prototype = {
},

_trigger: function( type, event, data ) {
var callback = this.options[ type ],
args;
var args, prop, orig,
callback = this.options[ type ];

data = data || {};
event = $.Event( event );
event.type = ( type === this.widgetEventPrefix ?
type :
this.widgetEventPrefix + type ).toLowerCase();
data = data || {};
// the original event may come from any element
// so we need to reset the target on the new event
event.target = this.element[ 0 ];

// copy original event properties over to the new event
// this would happen if we could call $.event.fix instead of $.Event
// but we don't have a way to force an event to be fixed multiple times
if ( event.originalEvent ) {
for ( var i = $.event.props.length, prop; i; ) {
prop = $.event.props[ --i ];
event[ prop ] = event.originalEvent[ prop ];
orig = event.originalEvent;
if ( orig ) {
for ( prop in orig ) {
if ( !( prop in event ) ) {
event[ prop ] = orig[ prop ];
}
}
}

// the original event may come from any element
// so we need to reset the target on the new event
event.target = this.element[0];

this.element.trigger( event, data );

args = $.isArray( data ) ?

0 comments on commit 91ef69d

Please sign in to comment.
You can’t perform that action at this time.