Sha256: a3cb8e7213a91cde7ee965820c21ac0141a3b6f6a8c0cd76d87ffdadebef06d8

Contents?: true

Size: 1.33 KB

Versions: 24

Compression:

Stored size: 1.33 KB

Contents

//>>excludeStart("exclude", pragmas.exclude);
define([
	"shoestring",
	"dom/css/exceptions"
], function(){
//>>excludeEnd("exclude");// TODO: This code should be consistent with attr().

	(function() {
		var cssExceptions = shoestring.cssExceptions;

		// marginRight instead of margin-right
		function convertPropertyName( str ) {
			return str.replace( /\-([A-Za-z])/g, function ( match, character ) {
				return character.toUpperCase();
			});
		}

		/**
		 * Private function for setting the style of an element.
		 *
		 * **NOTE** Please use the [css](../css.js.html) method instead.
		 *
		 * @method _setStyle
		 * @param {HTMLElement} element The element we want to style.
		 * @param {string} property The property being used to style the element.
		 * @param {string} value The css value for the style property.
		 */
		shoestring._setStyle = function( element, property, value ) {
			var convertedProperty = convertPropertyName(property);

			element.style[ property ] = value;

			if( convertedProperty !== property ) {
				element.style[ convertedProperty ] = value;
			}

			if( cssExceptions[ property ] ) {
				for( var j = 0, k = cssExceptions[ property ].length; j<k; j++ ) {
					element.style[ cssExceptions[ property ][ j ] ] = value;
				}
			}
		};
	})();

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

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
trusty-cms-4.1.8 node_modules/shoestring/src/dom/css/setStyle.js
trusty-cms-4.1.7 node_modules/shoestring/src/dom/css/setStyle.js
trusty-cms-4.1.6 node_modules/shoestring/src/dom/css/setStyle.js
trusty-cms-4.1.5 node_modules/shoestring/src/dom/css/setStyle.js