mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Widget: Improve readability in $.widget.bridge()
Closes gh-1409
(cherry picked from commit 713688dccd
)
This commit is contained in:
parent
311696715e
commit
69bd7a7a75
11
ui/widget.js
11
ui/widget.js
@ -190,11 +190,6 @@ $.widget.bridge = function( name, object ) {
|
||||
args = widget_slice.call( arguments, 1 ),
|
||||
returnValue = this;
|
||||
|
||||
// allow multiple hashes to be passed on init
|
||||
options = !isMethodCall && args.length ?
|
||||
$.widget.extend.apply( null, [ options ].concat(args) ) :
|
||||
options;
|
||||
|
||||
if ( isMethodCall ) {
|
||||
this.each(function() {
|
||||
var methodValue,
|
||||
@ -219,6 +214,12 @@ $.widget.bridge = function( name, object ) {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
// Allow multiple hashes to be passed on init
|
||||
if ( args.length ) {
|
||||
options = $.widget.extend.apply( null, [ options ].concat(args) );
|
||||
}
|
||||
|
||||
this.each(function() {
|
||||
var instance = $.data( this, fullName );
|
||||
if ( instance ) {
|
||||
|
Loading…
Reference in New Issue
Block a user