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',
|
'id', 'title', 'extension', 'size',
|
||||||
'transferadded', 'transferprogress'
|
'transferadded', 'transferprogress'
|
||||||
].map(function(id) {
|
].map(function(id) {
|
||||||
var key = Ox.getObjectById(oml.config.sortKeys, id);
|
var key = Ox.getObjectById(oml.config.itemKeys, id);
|
||||||
return {
|
return {
|
||||||
align: Ox.contains([
|
align: Ox.contains([
|
||||||
'size', 'transferprogress'
|
'size', 'transferprogress'
|
||||||
], id) ? 'right' : 'left',
|
], id) ? 'right' : 'left',
|
||||||
format: function(value) {
|
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,
|
id: id,
|
||||||
operator: oml.getSortOperator(id),
|
operator: oml.getSortOperator(id),
|
||||||
|
|
Loading…
Reference in a new issue