Sha256: 1fe4e32b5d4686b590ca3706943144e2c140a388e6203de2c173569020413282

Contents?: true

Size: 1.23 KB

Versions: 75

Compression:

Stored size: 1.23 KB

Contents

define( [
	"../core"
], function( jQuery ) {

"use strict";

// Multifunctional method to get and set values of a collection
// The value/s can optionally be executed if it's a function
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
	var i = 0,
		len = elems.length,
		bulk = key == null;

	// Sets many values
	if ( jQuery.type( key ) === "object" ) {
		chainable = true;
		for ( i in key ) {
			access( elems, fn, i, key[ i ], true, emptyGet, raw );
		}

	// Sets one value
	} else if ( value !== undefined ) {
		chainable = true;

		if ( !jQuery.isFunction( value ) ) {
			raw = true;
		}

		if ( bulk ) {

			// Bulk operations run against the entire set
			if ( raw ) {
				fn.call( elems, value );
				fn = null;

			// ...except when executing function values
			} else {
				bulk = fn;
				fn = function( elem, key, value ) {
					return bulk.call( jQuery( elem ), value );
				};
			}
		}

		if ( fn ) {
			for ( ; i < len; i++ ) {
				fn(
					elems[ i ], key, raw ?
					value :
					value.call( elems[ i ], i, fn( elems[ i ], key ) )
				);
			}
		}
	}

	if ( chainable ) {
		return elems;
	}

	// Gets
	if ( bulk ) {
		return fn.call( elems );
	}

	return len ? fn( elems[ 0 ], key ) : emptyGet;
};

return access;

} );

Version data entries

75 entries across 65 versions & 13 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/jquery/src/core/access.js
columbus3-0.5.1 bower_components/jquery/src/core/access.js
trusty-cms-3.6.0 spec/dummy/node_modules/jquery/src/core/access.js
trusty-cms-3.6.0 node_modules/jquery/src/core/access.js
trusty-cms-3.5.5 spec/dummy/node_modules/jquery/src/core/access.js
trusty-cms-3.5.5 node_modules/jquery/src/core/access.js
trusty-cms-3.5.4 spec/dummy/node_modules/jquery/src/core/access.js
trusty-cms-3.5.4 node_modules/jquery/src/core/access.js
trusty-cms-3.5.3 node_modules/jquery/src/core/access.js
trusty-cms-3.5.3 spec/dummy/node_modules/jquery/src/core/access.js
trusty-cms-3.5.2 spec/dummy/node_modules/jquery/src/core/access.js
trusty-cms-3.5.2 node_modules/jquery/src/core/access.js
trusty-cms-3.5.1 spec/dummy/node_modules/jquery/src/core/access.js
trusty-cms-3.5.1 node_modules/jquery/src/core/access.js
optimacms-0.4.3 spec/dummy/node_modules/jquery/src/core/access.js
optimacms-0.4.2 spec/dummy/node_modules/jquery/src/core/access.js
trusty-cms-3.5.0 node_modules/jquery/src/core/access.js
trusty-cms-3.5.0 spec/dummy/node_modules/jquery/src/core/access.js
trusty-cms-3.4.0 spec/dummy/node_modules/jquery/src/core/access.js
trusty-cms-3.4.0 node_modules/jquery/src/core/access.js