MCPcopy Create free account
hub / github.com/TruthHun/BookStack / access

Function access

static/wangEditor/js/lib/jquery-2.2.1.js:3585–3639  ·  view source on GitHub ↗
( elems, fn, key, value, chainable, emptyGet, raw )

Source from the content-addressed store, hash-verified

3583// Multifunctional method to get and set values of a collection
3584// The value/s can optionally be executed if it's a function
3585var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
3586 var i = 0,
3587 len = elems.length,
3588 bulk = key == null;
3589
3590 // Sets many values
3591 if ( jQuery.type( key ) === "object" ) {
3592 chainable = true;
3593 for ( i in key ) {
3594 access( elems, fn, i, key[ i ], true, emptyGet, raw );
3595 }
3596
3597 // Sets one value
3598 } else if ( value !== undefined ) {
3599 chainable = true;
3600
3601 if ( !jQuery.isFunction( value ) ) {
3602 raw = true;
3603 }
3604
3605 if ( bulk ) {
3606
3607 // Bulk operations run against the entire set
3608 if ( raw ) {
3609 fn.call( elems, value );
3610 fn = null;
3611
3612 // ...except when executing function values
3613 } else {
3614 bulk = fn;
3615 fn = function( elem, key, value ) {
3616 return bulk.call( jQuery( elem ), value );
3617 };
3618 }
3619 }
3620
3621 if ( fn ) {
3622 for ( ; i < len; i++ ) {
3623 fn(
3624 elems[ i ], key, raw ?
3625 value :
3626 value.call( elems[ i ], i, fn( elems[ i ], key ) )
3627 );
3628 }
3629 }
3630 }
3631
3632 return chainable ?
3633 elems :
3634
3635 // Gets
3636 bulk ?
3637 fn.call( elems ) :
3638 len ? fn( elems[ 0 ], key ) : emptyGet;
3639};
3640var acceptData = function( owner ) {
3641
3642 // Accepts only:

Callers 1

jquery-2.2.1.jsFile · 0.70

Calls 2

jQueryFunction · 0.70
fnFunction · 0.50

Tested by

no test coverage detected