Added empty value filter as fallback
This commit is contained in:
parent
07bf26b8d3
commit
20e21fa3d7
1 changed files with 11 additions and 0 deletions
|
@ -76,6 +76,17 @@ window.ls.filter
|
||||||
let total = Math.ceil(parseInt($value || 0) / env.PAGING_LIMIT);
|
let total = Math.ceil(parseInt($value || 0) / env.PAGING_LIMIT);
|
||||||
return (total) ? total : 1;
|
return (total) ? total : 1;
|
||||||
})
|
})
|
||||||
|
.add('emptyDash', function ($value, env) {
|
||||||
|
if(!$value) {
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Array.isArray($value)) {
|
||||||
|
return $value.length + ' items';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $value;
|
||||||
|
})
|
||||||
.add('humanFileSize', function ($value) {
|
.add('humanFileSize', function ($value) {
|
||||||
if (!$value) {
|
if (!$value) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue