Make "paging" visible also on the bottom of the search results

* Allow for repeating E.template function by reimplementing base
This commit is contained in:
Bofh 2022-12-12 23:47:31 +01:00
parent 5b00931878
commit 489297deb9
3 changed files with 15 additions and 8 deletions

View File

@ -42,21 +42,24 @@ var E = {
}
},
template: function(_id, cback) {
var tpl = E.elemid(_id+'-item');
if (tpl !== null) {
tpl = tpl.outerHTML;
tpl = tpl.replace('id="'+_id+'-item"','class="item"');
tpl = tpl.replace('data-src=', 'src=');
}
var elem = null;
elem = E.elemid(_id);
if (elem === null)
elem = E.element(_id);
if (elem === null)
return;
if (typeof cback === 'string')
if (typeof cback === 'string') {
elem.innerText = cback;
else elem.innerHTML = cback(tpl);
return;
}
_id = elem.id;
var tpl = E.elemid(_id+'-item');
if (tpl !== null) {
tpl = tpl.outerHTML;
tpl = tpl.replace('id="'+_id+'-item"','class="item"');
tpl = tpl.replace('data-src=', 'src=');
elem.innerHTML = cback(tpl);
}
},
http_template: function(name, cback) {
const slug = 'html_cache__'+name.replaceAll('/','--');

View File

@ -176,5 +176,6 @@
</div>
</div>
</div>
<div id="paging" class="bottom"></div>
</div>
<br>

View File

@ -255,6 +255,9 @@ window.view.instance = {
tpl = tpl.replaceAll('{total_users}', js['total']);
return tpl+'<br>';
});
E.template('#paging.bottom', function(TPL) {
return E.elemid('paging').innerHTML;
});
});
},
save_filter: function() {