diff options
author | Scott González <scott.gonzalez@gmail.com> | 2011-11-21 11:31:51 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-11-21 11:31:51 -0500 |
commit | 5fb9629766f10a9119e0099bd8aee06f86cc3f30 (patch) | |
tree | 37a3d6c1ec5b56f612ed0adee6226a1f950e6318 | |
parent | 91ef69d7503f11f2b6223b9c0061fca51e3a006f (diff) | |
download | jquery-ui-5fb9629766f10a9119e0099bd8aee06f86cc3f30.tar.gz jquery-ui-5fb9629766f10a9119e0099bd8aee06f86cc3f30.zip |
Widget: Simplify data normalization in _trigger().
-rw-r--r-- | ui/jquery.ui.widget.js | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index 0d52fb534..4f47a008b 100644 --- a/ui/jquery.ui.widget.js +++ b/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() ); } }; |