Skip to content

Commit 69bd7a7

Browse files
thg2kscottgonzalez
authored andcommitted
Widget: Improve readability in $.widget.bridge()
Closes gh-1409 (cherry picked from commit 713688d)
1 parent 3116967 commit 69bd7a7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ui/widget.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,6 @@ $.widget.bridge = function( name, object ) {
190190
args = widget_slice.call( arguments, 1 ),
191191
returnValue = this;
192192

193-
// allow multiple hashes to be passed on init
194-
options = !isMethodCall && args.length ?
195-
$.widget.extend.apply( null, [ options ].concat(args) ) :
196-
options;
197-
198193
if ( isMethodCall ) {
199194
this.each(function() {
200195
var methodValue,
@@ -219,6 +214,12 @@ $.widget.bridge = function( name, object ) {
219214
}
220215
});
221216
} else {
217+
218+
// Allow multiple hashes to be passed on init
219+
if ( args.length ) {
220+
options = $.widget.extend.apply( null, [ options ].concat(args) );
221+
}
222+
222223
this.each(function() {
223224
var instance = $.data( this, fullName );
224225
if ( instance ) {

0 commit comments

Comments
 (0)