src/node/js/node.js
function(newStyles) {

	if( !this.getAttribute('style') ) {
		this.setAttribute('style', '');
	}

	var newStyle = '',

		// If the style matches one of the following, and we pass in an integer, default the unit
		// E.g., 10 becomes 10px
		defaultToUnit = {
			top: 'px',
			left: 'px',
			width: 'px',
			height: 'px'
		},

		i,

		eachStyleValue,

		// Keep track of an array of styles that we need to remove
		newStyleKeys = [];

	for( i in newStyles ) {
		var styleKey = this._jsStyle(i),
		eachStyleVal = newStyles[i];

		// Default the unit if necessary
		if (defaultToUnit[styleKey] && !isNaN(eachStyleVal)) {
			eachStyleVal += defaultToUnit[styleKey];
		}

		this._node.style[styleKey] = eachStyleVal;
	}

	return this;
}
function(newStyles) {

	if( !this.getAttribute('style') ) {
		this.setAttribute('style', '');
	}

	var newStyle = '',

		// If the style matches one of the following, and we pass in an integer, default the unit
		// E.g., 10 becomes 10px
		defaultToUnit = {
			top: 'px',
			left: 'px',
			width: 'px',
			height: 'px'
		},

		i,

		eachStyleValue,

		// Keep track of an array of styles that we need to remove
		newStyleKeys = [];

	for( i in newStyles ) {
		var styleKey = this._jsStyle(i),
		eachStyleVal = newStyles[i];

		// Default the unit if necessary
		if (defaultToUnit[styleKey] && !isNaN(eachStyleVal)) {
			eachStyleVal += defaultToUnit[styleKey];
		}

		this._node.style[styleKey] = eachStyleVal;
	}

	return this;
}
function ( newStyles ) { if ( ! this . getAttribute ( 'style' ) ) { this . setAttribute ( 'style' , '' ) ; } var newStyle = '' , // If the style matches one of the following, and we pass in an integer, default the unit // E.g., 10 becomes 10px defaultToUnit = { top : 'px' , left : 'px' , width : 'px' , height : 'px' } , i , eachStyleValue , // Keep track of an array of styles that we need to remove newStyleKeys = [ ] ; for ( i in newStyles ) { var styleKey = this . _jsStyle ( i ) , eachStyleVal = newStyles [ i ] ; // Default the unit if necessary if ( defaultToUnit [ styleKey ] && ! isNaN ( eachStyleVal ) ) { eachStyleVal += defaultToUnit [ styleKey ] ; } this . _node . style [ styleKey ] = eachStyleVal ; } return this ; }
Sets multiple styles
@param object Object map of styles to set
Sets multiple styles