]> source.dussan.org Git - jquery-ui.git/commitdiff
Widget: Simplify data normalization in _trigger().
authorScott González <scott.gonzalez@gmail.com>
Mon, 21 Nov 2011 16:31:51 +0000 (11:31 -0500)
committerScott González <scott.gonzalez@gmail.com>
Mon, 21 Nov 2011 16:31:51 +0000 (11:31 -0500)
ui/jquery.ui.widget.js

index 0d52fb53405aad07013ae6389a7b79cebcc29bfe..4f47a008b054c55eb0675a3dd105c8cea6977084 100644 (file)
@@ -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() );
        }
 };