use itemKeys and turn .format into function
This commit is contained in:
parent
7da4bd0ec3
commit
6d659b8049
1 changed files with 7 additions and 2 deletions
|
@ -9,13 +9,18 @@ oml.ui.transfersPanel = function() {
|
|||
'id', 'title', 'extension', 'size',
|
||||
'transferadded', 'transferprogress'
|
||||
].map(function(id) {
|
||||
var key = Ox.getObjectById(oml.config.sortKeys, id);
|
||||
var key = Ox.getObjectById(oml.config.itemKeys, id);
|
||||
return {
|
||||
align: Ox.contains([
|
||||
'size', 'transferprogress'
|
||||
], id) ? 'right' : 'left',
|
||||
format: function(value) {
|
||||
return Ox.encodeHTMLEntities(key.format(value));
|
||||
return Ox.encodeHTMLEntities(key.format
|
||||
? Ox['format' + Ox.toTitleCase(key.format.type)].apply(
|
||||
this, [value].concat(key.format.args || [])
|
||||
)
|
||||
: Ox.isArray(key.type) ? (value || []).join(', ')
|
||||
: (value || ''));
|
||||
},
|
||||
id: id,
|
||||
operator: oml.getSortOperator(id),
|
||||
|
|
Loading…
Reference in a new issue