Sha256: b1bf68bbb05a8ad8d95a6ed0766e8185c0fd7be0399d153b33367a04e005c5e4

Contents?: true

Size: 929 Bytes

Versions: 24

Compression:

Stored size: 929 Bytes

Contents

//>>excludeStart("exclude", pragmas.exclude);
define([ "shoestring" ], function(){
//>>excludeEnd("exclude");

  /**
	 * Get the value of the first element of the set or set the value of all the elements in the set.
	 *
	 * @param {string} name The attribute name.
	 * @param {string} value The new value for the attribute.
	 * @return {shoestring|string|undefined}
	 * @this {shoestring}
	 */
	shoestring.fn.attr = function( name, value ){
		var nameStr = typeof( name ) === "string";

		if( value !== undefined || !nameStr ){
			return this.each(function(){
				if( nameStr ){
					this.setAttribute( name, value );
				}	else {
					for( var i in name ){
						if( name.hasOwnProperty( i ) ){
							this.setAttribute( i, name[ i ] );
						}
					}
				}
			});
		} else {
			return this[ 0 ] ? this[ 0 ].getAttribute( name ) : undefined;
		}
	};

//>>excludeStart("exclude", pragmas.exclude);
});
//>>excludeEnd("exclude");

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
trusty-cms-6.3.1 node_modules/shoestring/src/dom/attr.js
trusty-cms-5.0.7 node_modules/shoestring/src/dom/attr.js
trusty-cms-5.0.6 node_modules/shoestring/src/dom/attr.js
trusty-cms-5.0.5 node_modules/shoestring/src/dom/attr.js
trusty-cms-5.0.4 node_modules/shoestring/src/dom/attr.js
trusty-cms-5.0.3 node_modules/shoestring/src/dom/attr.js
trusty-cms-5.0.2 node_modules/shoestring/src/dom/attr.js
trusty-cms-5.0.1 node_modules/shoestring/src/dom/attr.js
trusty-cms-4.3.5 node_modules/shoestring/src/dom/attr.js
trusty-cms-5.0.0 node_modules/shoestring/src/dom/attr.js
trusty-cms-4.3.4 node_modules/shoestring/src/dom/attr.js
trusty-cms-4.3.3 node_modules/shoestring/src/dom/attr.js
trusty-cms-4.3.2 node_modules/shoestring/src/dom/attr.js
trusty-cms-4.3.1 node_modules/shoestring/src/dom/attr.js
trusty-cms-4.3 node_modules/shoestring/src/dom/attr.js
trusty-cms-4.2.3 node_modules/shoestring/src/dom/attr.js
trusty-cms-4.2.2 node_modules/shoestring/src/dom/attr.js
trusty-cms-4.2.1 node_modules/shoestring/src/dom/attr.js
trusty-cms-4.2 node_modules/shoestring/src/dom/attr.js
trusty-cms-4.1.9 node_modules/shoestring/src/dom/attr.js