Iheartweb/AthenaUIFramework — Issue #43: Use json2.js to stringify configs.
Author: Iheartweb
Created: 2011-12-22 21:43:08+00:00
State: open

//TODO: USING JSON.STRINGIFY WILL BREAK IN OLDER BROWSERS
Athena.decorate = function( $element, keys, settings ) {
var nodeKeys = ( $element.attr( ATTR ) ) ? $element.attr( ATTR ).split( ' ' ) : [];
keys = _.union( nodeKeys, keys );
settings = settings;
if( settings ) {
return $element.attr( ATTR, keys.join( ' ' ) ).attr( ATTR + '-config', JSON.stringify( settings ) );
}
return $element.attr( ATTR, keys.join( ' ' ) );
};