1
0
Fork 0
forked from 0x2620/oxjs

add themed colored elements

This commit is contained in:
rlx 2011-10-26 14:52:03 +00:00
commit 188656bd99
5 changed files with 147 additions and 130 deletions

View file

@ -555,14 +555,19 @@ Ox.TextList = function(options, self) {
// fixme: this may be obscure...
// since the format of a value may depend on another value,
// we pass all data as a second parameter to the supplied format function
var format = self.format[key];
var format = self.format[key], formatFunction;
if (value === null) {
value = '';
} else if (format) {
value = Ox.isObject(format)
? Ox['format' + Ox.toTitleCase(format.type)]
.apply(this, Ox.merge([value], format.args || []))
: format(value, data);
if (Ox.isObject(format)) {
value = (
/^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox
)['format' + Ox.toTitleCase(format.type)].apply(
this, Ox.merge([value], format.args || [])
);
} else {
value = format(value, data);
}
} else if (Ox.isArray(value)) {
value = value.join(', ');
}