Saturday, 10 August 2013

Constant object with dependant fields

Constant object with dependant fields

I'm trying to keep all my constants together within a literal object:
var STYLE = {
icons: {
success: 'ui-icon ui-icon-circle-check'
},
message_classes_by_tag: {
// any way I can get this reference to work?
// so that i can keep all my icon definitions under 'icons'...
'success': { base: 'ui-state-highlight', icon: STYLE.icons.success }
}
};
So far I've tried STYLE and this. Both being evaluated as undefined
Is what I'm trying even possible?

No comments:

Post a Comment