minor changes in tree list

This commit is contained in:
rolux 2011-07-26 16:36:31 +02:00
parent 4b1eadc021
commit ff1714013c

View file

@ -138,19 +138,19 @@ Ox.TreeList = function(options, self) {
//Ox.print('parseData', key, value) //Ox.print('parseData', key, value)
var ret = { var ret = {
id: Ox.uid(), id: Ox.uid(),
title: key.toString() title: key.toString() + ': '
}, },
type = Ox.typeOf(value); type = Ox.typeOf(value);
if (type == 'array' || type == 'object') { if (type == 'array' || type == 'object') {
ret.title += ': ' + Ox.toTitleCase(type); ret.title += Ox.toTitleCase(type);
ret.items = Ox.map(Ox.sort(Ox.keys(value)), function(k) { ret.items = Ox.map(Ox.sort(Ox.keys(value)), function(k) {
return parseData(k, value[k]); return parseData(k, value[k]);
}); });
} else { } else {
ret.title += ': ' + ( ret.title += (
type == 'function' ? type == 'function' ?
value.toString().split('{')[0] : value.toString().split('{')[0] :
JSON.stringify(value) JSON.stringify(value)
); );
} }
return ret; return ret;