dont format null values, fixes #116

This commit is contained in:
j 2016-01-11 12:53:14 +05:30
parent 9253e65e79
commit 9a3c457d6a

View file

@ -16,7 +16,9 @@ oml.ui.gridView = function() {
width = Math.round(ratio >= 1 ? size : size * ratio), width = Math.round(ratio >= 1 ? size : size * ratio),
height = Math.round(ratio <= 1 ? size : size / ratio), height = Math.round(ratio <= 1 ? size : size / ratio),
sortKey = sort[0].key, sortKey = sort[0].key,
info = Ox.getObjectById(oml.config.sortKeys, sortKey).format( info = Ox.isNull(data[sortKey])
? ''
: Ox.getObjectById(oml.config.sortKeys, sortKey).format(
Ox.contains(['title', 'random'], sortKey) Ox.contains(['title', 'random'], sortKey)
? (data.author || '') : data[sortKey] ? (data.author || '') : data[sortKey]
); );