mirror of
https://github.com/Mottie/tablesorter.git
synced 2025-01-12 15:24:21 +00:00
Pager now outputs zero instead of an empty string for no filter results
This commit is contained in:
parent
6373f821d6
commit
4aea98040c
@ -139,8 +139,12 @@
|
|||||||
})
|
})
|
||||||
// {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object)
|
// {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object)
|
||||||
.replace(/\{\w+(\s*:\s*\w+)?\}/gi, function(m){
|
.replace(/\{\w+(\s*:\s*\w+)?\}/gi, function(m){
|
||||||
var t = m.replace(/[{}\s]/g,''), a = t.split(':'), d = p.ajaxData;
|
var str = m.replace(/[{}\s]/g,''),
|
||||||
return a.length > 1 && d && d[a[0]] ? d[a[0]][a[1]] : p[t] || (d ? d[t] : '') || '';
|
extra = str.split(':'),
|
||||||
|
data = p.ajaxData,
|
||||||
|
// return zero for default page/row numbers
|
||||||
|
deflt = /(rows?|pages?)$/i.test(str) ? 0 : '';
|
||||||
|
return extra.length > 1 && data && data[extra[0]] ? data[extra[0]][extra[1]] : p[str] || (data ? data[str] : deflt) || deflt;
|
||||||
});
|
});
|
||||||
if (out.length) {
|
if (out.length) {
|
||||||
out[ (out[0].tagName === 'INPUT') ? 'val' : 'html' ](s);
|
out[ (out[0].tagName === 'INPUT') ? 'val' : 'html' ](s);
|
||||||
|
Loading…
Reference in New Issue
Block a user