Sha256: ea17185abdf20aa74ebcd94c1cd23cd4a0896ee4492a98e7872093d06c5b6ed8
Contents?: true
Size: 1.19 KB
Versions: 24
Compression:
Stored size: 1.19 KB
Contents
//>>excludeStart("exclude", pragmas.exclude); define([ "shoestring", "dom/is" // note this dependency is only used for a dev error ], function(){ //>>excludeEnd("exclude"); /** * Get data attached to the first element or set data values on all elements in the current set. * * @param {string} name The data attribute name. * @param {any} value The value assigned to the data attribute. * @return {any|shoestring} * @this shoestring */ shoestring.fn.data = function( name, value ){ if( name !== undefined ){ if( value !== undefined ){ return this.each(function(){ if( !this.shoestringData ){ this.shoestringData = {}; } this.shoestringData[ name ] = value; }); } else { if( this[ 0 ] ) { if( this[ 0 ].shoestringData ) { return this[ 0 ].shoestringData[ name ]; } //>>includeStart("development", pragmas.development); if( shoestring( this[ 0 ] ).is( "[data-" + name + "]" ) ){ shoestring.error( 'data-attr-alias' ); } //>>includeEnd("development"); } } } else { return this[ 0 ] ? this[ 0 ].shoestringData || {} : undefined; } }; //>>excludeStart("exclude", pragmas.exclude); }); //>>excludeEnd("exclude");
Version data entries
24 entries across 24 versions & 1 rubygems