aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorGiovanni Giacobbi <giovanni@giacobbi.net>2014-12-22 00:35:24 +0100
committerScott González <scott.gonzalez@gmail.com>2014-12-31 10:50:03 -0500
commit713688dccdfc7eddd596cdd1a3522e2ce9fb9d2a (patch)
tree9b264fcf3486acca3598691b1310e70218197f85 /ui
parentb6bec797d6a8ef0b377a866c38c67e66a626b45f (diff)
downloadjquery-ui-713688dccdfc7eddd596cdd1a3522e2ce9fb9d2a.tar.gz
jquery-ui-713688dccdfc7eddd596cdd1a3522e2ce9fb9d2a.zip
Widget: Improve readability in `$.widget.bridge()`
Closes gh-1409
Diffstat (limited to 'ui')
-rw-r--r--ui/widget.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/ui/widget.js b/ui/widget.js
index 302705044..0b9362532 100644
--- a/ui/widget.js
+++ b/ui/widget.js
@@ -195,11 +195,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,
@@ -224,6 +219,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 ) {