diff options
author | Scott González <scott.gonzalez@gmail.com> | 2010-01-15 22:15:18 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2010-01-15 22:15:18 +0000 |
commit | 20360688a078d190b6b35e24055dc0513e0cf6db (patch) | |
tree | 27724ea1c45cf161dfca8ef0e2273609565a22cd | |
parent | 9247295098c0886f11f1db3b2051f6a06f42fc80 (diff) | |
download | jquery-ui-20360688a078d190b6b35e24055dc0513e0cf6db.tar.gz jquery-ui-20360688a078d190b6b35e24055dc0513e0cf6db.zip |
Widget: conform to coding standards.
-rw-r--r-- | ui/jquery.ui.widget.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index 18d2b920d..a5ae00e91 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -65,18 +65,18 @@ $.widget = function( name, base, prototype ) { }; $.widget.bridge = function( name, object ) { - $.fn[name] = function( options ) { + $.fn[ name ] = function( options ) { var isMethodCall = typeof options === "string", args = Array.prototype.slice.call( arguments, 1 ), returnValue = this; // allow multiple hashes to be passed on init - options = !isMethodCall && args.length - ? $.extend.apply(null, [true, options].concat(args)) - : options; + options = !isMethodCall && args.length ? + $.extend.apply( null, [ true, options ].concat(args) ) : + options; // prevent calls to internal methods - if ( isMethodCall && options.substring(0, 1) === "_" ) { + if ( isMethodCall && options.substring( 0, 1 ) === "_" ) { return returnValue; } @@ -84,7 +84,7 @@ $.widget.bridge = function( name, object ) { this.each(function() { var instance = $.data( this, name ), methodValue = instance && $.isFunction( instance[options] ) ? - instance[options].apply( instance, args ) : + instance[ options ].apply( instance, args ) : instance; if ( methodValue !== instance && methodValue !== undefined ) { returnValue = methodValue; @@ -207,8 +207,8 @@ $.Widget.prototype = { event = $.Event( event ); event.type = ( type === this.widgetEventPrefix ? - type : - this.widgetEventPrefix + type ).toLowerCase(); + type : + this.widgetEventPrefix + type ).toLowerCase(); data = data || {}; // copy original event properties over to the new event @@ -223,8 +223,9 @@ $.Widget.prototype = { this.element.trigger( event, data ); - return !($.isFunction(callback) && callback.call( this.element[0], event, data ) === false - || event.isDefaultPrevented()); + return !( $.isFunction(callback) && + callback.call( this.element[0], event, data ) === false || + event.isDefaultPrevented() ); } }; |