Skip to content
Permalink
Browse files

Widget: Simplify data normalization in _trigger().

  • Loading branch information
scottgonzalez committed Nov 21, 2011
1 parent 91ef69d commit 5fb9629766f10a9119e0099bd8aee06f86cc3f30
Showing with 2 additions and 7 deletions.
  1. +2 −7 ui/jquery.ui.widget.js
@@ -374,7 +374,7 @@ $.Widget.prototype = {
},

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

data = data || {};
@@ -397,13 +397,8 @@ $.Widget.prototype = {
}

this.element.trigger( event, data );

args = $.isArray( data ) ?
[ event ].concat( data ) :
[ event, data ];

return !( $.isFunction( callback ) &&
callback.apply( this.element[0], args ) === false ||
callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
event.isDefaultPrevented() );
}
};

0 comments on commit 5fb9629

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