Skip to content

Commit 713688d

Browse files
thg2kscottgonzalez
authored andcommitted
Widget: Improve readability in $.widget.bridge()
Closes jquerygh-1409
1 parent b6bec79 commit 713688d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ui/widget.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,6 @@ $.widget.bridge = function( name, object ) {
195195
args = widget_slice.call( arguments, 1 ),
196196
returnValue = this;
197197

198-
// allow multiple hashes to be passed on init
199-
options = !isMethodCall && args.length ?
200-
$.widget.extend.apply( null, [ options ].concat(args) ) :
201-
options;
202-
203198
if ( isMethodCall ) {
204199
this.each(function() {
205200
var methodValue,
@@ -224,6 +219,12 @@ $.widget.bridge = function( name, object ) {
224219
}
225220
});
226221
} else {
222+
223+
// Allow multiple hashes to be passed on init
224+
if ( args.length ) {
225+
options = $.widget.extend.apply( null, [ options ].concat(args) );
226+
}
227+
227228
this.each(function() {
228229
var instance = $.data( this, fullName );
229230
if ( instance ) {

0 commit comments

Comments
 (0)