diff options
author | Giovanni Giacobbi <giovanni@giacobbi.net> | 2014-12-22 00:35:24 +0100 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2015-02-09 11:51:52 -0500 |
commit | 69bd7a7a75015a63dafe8b284c2a0c3af9d649ee (patch) | |
tree | 60329309169c1034d4d073097c59317f8f9d44c9 | |
parent | 311696715e8fdf7eb44621328f5b111a60f0408c (diff) | |
download | jquery-ui-69bd7a7a75015a63dafe8b284c2a0c3af9d649ee.tar.gz jquery-ui-69bd7a7a75015a63dafe8b284c2a0c3af9d649ee.zip |
Widget: Improve readability in `$.widget.bridge()`
Closes gh-1409
(cherry picked from commit 713688dccdfc7eddd596cdd1a3522e2ce9fb9d2a)
-rw-r--r-- | ui/widget.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ui/widget.js b/ui/widget.js index 41425b1a9..8fbce2bf2 100644 --- a/ui/widget.js +++ b/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 ) { |