MCPcopy Index your code
hub / github.com/caike/jQuery-Simple-Timer / access

Function access

examples/bundle.js:4635–4689  ·  view source on GitHub ↗
( elems, fn, key, value, chainable, emptyGet, raw )

Source from the content-addressed store, hash-verified

4633// Multifunctional method to get and set values of a collection
4634// The value/s can optionally be executed if it's a function
4635var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
4636 var i = 0,
4637 length = elems.length,
4638 bulk = key == null;
4639
4640 // Sets many values
4641 if ( jQuery.type( key ) === "object" ) {
4642 chainable = true;
4643 for ( i in key ) {
4644 access( elems, fn, i, key[ i ], true, emptyGet, raw );
4645 }
4646
4647 // Sets one value
4648 } else if ( value !== undefined ) {
4649 chainable = true;
4650
4651 if ( !jQuery.isFunction( value ) ) {
4652 raw = true;
4653 }
4654
4655 if ( bulk ) {
4656
4657 // Bulk operations run against the entire set
4658 if ( raw ) {
4659 fn.call( elems, value );
4660 fn = null;
4661
4662 // ...except when executing function values
4663 } else {
4664 bulk = fn;
4665 fn = function( elem, key, value ) {
4666 return bulk.call( jQuery( elem ), value );
4667 };
4668 }
4669 }
4670
4671 if ( fn ) {
4672 for ( ; i < length; i++ ) {
4673 fn(
4674 elems[ i ],
4675 key,
4676 raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) )
4677 );
4678 }
4679 }
4680 }
4681
4682 return chainable ?
4683 elems :
4684
4685 // Gets
4686 bulk ?
4687 fn.call( elems ) :
4688 length ? fn( elems[ 0 ], key ) : emptyGet;
4689};
4690var rcheckableType = ( /^(?:checkbox|radio)$/i );
4691
4692var rtagName = ( /<([\w:-]+)/ );

Callers 1

bundle.jsFile · 0.85

Calls 1

jQueryFunction · 0.85

Tested by

no test coverage detected