From a9829a5734f158df3ccbd88d0cd499bab7fac760 Mon Sep 17 00:00:00 2001 From: Giovanni Giacobbi Date: Mon, 22 Dec 2014 00:35:24 +0100 Subject: [PATCH 1/2] improved readability in $.widget.bridge --- ui/widget.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/widget.js b/ui/widget.js index 30270504437..84667981da5 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,11 @@ $.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 ) { From 6768ac58a27ba933fdb61be1f9dba2fa96a0052d Mon Sep 17 00:00:00 2001 From: Giovanni Giacobbi Date: Tue, 30 Dec 2014 16:20:23 +0100 Subject: [PATCH 2/2] fixed comment style according to guidelines --- ui/widget.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/widget.js b/ui/widget.js index 84667981da5..0b93625323b 100644 --- a/ui/widget.js +++ b/ui/widget.js @@ -219,7 +219,8 @@ $.widget.bridge = function( name, object ) { } }); } else { - // allow multiple hashes to be passed on init + + // Allow multiple hashes to be passed on init if ( args.length ) { options = $.widget.extend.apply( null, [ options ].concat(args) ); }