mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Widget: Simplify data normalization in _trigger().
This commit is contained in:
parent
91ef69d750
commit
5fb9629766
9
ui/jquery.ui.widget.js
vendored
9
ui/jquery.ui.widget.js
vendored
@ -374,7 +374,7 @@ $.Widget.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_trigger: function( type, event, data ) {
|
_trigger: function( type, event, data ) {
|
||||||
var args, prop, orig,
|
var prop, orig,
|
||||||
callback = this.options[ type ];
|
callback = this.options[ type ];
|
||||||
|
|
||||||
data = data || {};
|
data = data || {};
|
||||||
@ -397,13 +397,8 @@ $.Widget.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.element.trigger( event, data );
|
this.element.trigger( event, data );
|
||||||
|
|
||||||
args = $.isArray( data ) ?
|
|
||||||
[ event ].concat( data ) :
|
|
||||||
[ event, data ];
|
|
||||||
|
|
||||||
return !( $.isFunction( callback ) &&
|
return !( $.isFunction( callback ) &&
|
||||||
callback.apply( this.element[0], args ) === false ||
|
callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
|
||||||
event.isDefaultPrevented() );
|
event.isDefaultPrevented() );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user