forked from 0x2620/oxjs
add themed colored elements
This commit is contained in:
parent
fb2ae1dee2
commit
188656bd99
5 changed files with 147 additions and 130 deletions
|
|
@ -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(', ');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue