Skip to content

Commit 2036068

Browse files
committed
Widget: conform to coding standards.
1 parent 9247295 commit 2036068

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

ui/jquery.ui.widget.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,26 @@ $.widget = function( name, base, prototype ) {
6565
};
6666

6767
$.widget.bridge = function( name, object ) {
68-
$.fn[name] = function( options ) {
68+
$.fn[ name ] = function( options ) {
6969
var isMethodCall = typeof options === "string",
7070
args = Array.prototype.slice.call( arguments, 1 ),
7171
returnValue = this;
7272

7373
// allow multiple hashes to be passed on init
74-
options = !isMethodCall && args.length
75-
? $.extend.apply(null, [true, options].concat(args))
76-
: options;
74+
options = !isMethodCall && args.length ?
75+
$.extend.apply( null, [ true, options ].concat(args) ) :
76+
options;
7777

7878
// prevent calls to internal methods
79-
if ( isMethodCall && options.substring(0, 1) === "_" ) {
79+
if ( isMethodCall && options.substring( 0, 1 ) === "_" ) {
8080
return returnValue;
8181
}
8282

8383
if ( isMethodCall ) {
8484
this.each(function() {
8585
var instance = $.data( this, name ),
8686
methodValue = instance && $.isFunction( instance[options] ) ?
87-
instance[options].apply( instance, args ) :
87+
instance[ options ].apply( instance, args ) :
8888
instance;
8989
if ( methodValue !== instance && methodValue !== undefined ) {
9090
returnValue = methodValue;
@@ -207,8 +207,8 @@ $.Widget.prototype = {
207207

208208
event = $.Event( event );
209209
event.type = ( type === this.widgetEventPrefix ?
210-
type :
211-
this.widgetEventPrefix + type ).toLowerCase();
210+
type :
211+
this.widgetEventPrefix + type ).toLowerCase();
212212
data = data || {};
213213

214214
// copy original event properties over to the new event
@@ -223,8 +223,9 @@ $.Widget.prototype = {
223223

224224
this.element.trigger( event, data );
225225

226-
return !($.isFunction(callback) && callback.call( this.element[0], event, data ) === false
227-
|| event.isDefaultPrevented());
226+
return !( $.isFunction(callback) &&
227+
callback.call( this.element[0], event, data ) === false ||
228+
event.isDefaultPrevented() );
228229
}
229230
};
230231

0 commit comments

Comments
 (0)