diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
commit | a2190ac74dd4d7080b12bab90e552d7aa81209ef (patch) | |
tree | 8b31f38de9882d18df54cf8d9e0de74167a094eb /resources/src/jquery/jquery.expandableField.js | |
parent | 15e69f7b20b6596b9148030acce5b59993b95a45 (diff) | |
parent | 257401d8b2cf661adf36c84b0e3fd1cf85e33c22 (diff) |
Merge branch 'mw-1.26'
Diffstat (limited to 'resources/src/jquery/jquery.expandableField.js')
-rw-r--r-- | resources/src/jquery/jquery.expandableField.js | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/resources/src/jquery/jquery.expandableField.js b/resources/src/jquery/jquery.expandableField.js index 48341bc5..221e6bbe 100644 --- a/resources/src/jquery/jquery.expandableField.js +++ b/resources/src/jquery/jquery.expandableField.js @@ -23,7 +23,7 @@ expandField: function ( e, context ) { context.config.beforeExpand.call( context.data.$field, context ); context.data.$field - .animate( { 'width': context.data.expandedWidth }, 'fast', function () { + .animate( { width: context.data.expandedWidth }, 'fast', function () { context.config.afterExpand.call( this, context ); } ); }, @@ -33,18 +33,19 @@ condenseField: function ( e, context ) { context.config.beforeCondense.call( context.data.$field, context ); context.data.$field - .animate( { 'width': context.data.condensedWidth }, 'fast', function () { + .animate( { width: context.data.condensedWidth }, 'fast', function () { context.config.afterCondense.call( this, context ); } ); }, /** * Sets the value of a property, and updates the widget accordingly - * @param property String Name of property - * @param value Mixed Value to set property with + * + * @param {String} property Name of property + * @param {Mixed} value Value to set property with */ configure: function ( context, property, value ) { // TODO: Validate creation using fallback values - context.config[property] = value; + context.config[ property ] = value; } }; @@ -87,20 +88,20 @@ /* API */ // Handle various calling styles if ( args.length > 0 ) { - if ( typeof args[0] === 'object' ) { + if ( typeof args[ 0 ] === 'object' ) { // Apply set of properties - for ( key in args[0] ) { - $.expandableField.configure( context, key, args[0][key] ); + for ( key in args[ 0 ] ) { + $.expandableField.configure( context, key, args[ 0 ][ key ] ); } - } else if ( typeof args[0] === 'string' ) { + } else if ( typeof args[ 0 ] === 'string' ) { if ( args.length > 1 ) { // Set property values - $.expandableField.configure( context, args[0], args[1] ); + $.expandableField.configure( context, args[ 0 ], args[ 1 ] ); // TODO: Do we need to check both null and undefined? } else if ( returnValue === null || returnValue === undefined ) { // Get property values, but don't give access to internal data - returns only the first - returnValue = ( args[0] in context.config ? undefined : context.config[args[0]] ); + returnValue = ( args[ 0 ] in context.config ? undefined : context.config[ args[ 0 ] ] ); } } } |