Skip to content

Commit 5fb9629

Browse files
committed
Widget: Simplify data normalization in _trigger().
1 parent 91ef69d commit 5fb9629

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

ui/jquery.ui.widget.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ $.Widget.prototype = {
374374
},
375375

376376
_trigger: function( type, event, data ) {
377-
var args, prop, orig,
377+
var prop, orig,
378378
callback = this.options[ type ];
379379

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

399399
this.element.trigger( event, data );
400-
401-
args = $.isArray( data ) ?
402-
[ event ].concat( data ) :
403-
[ event, data ];
404-
405400
return !( $.isFunction( callback ) &&
406-
callback.apply( this.element[0], args ) === false ||
401+
callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
407402
event.isDefaultPrevented() );
408403
}
409404
};

0 commit comments

Comments
 (0)