Improved UX in paging navigation on account results

This commit is contained in:
Bofh 2022-12-07 01:26:15 +01:00
parent 71ea98643c
commit 4b68ae654c
2 changed files with 8 additions and 5 deletions

View File

@ -1,10 +1,14 @@
<h3>Results: <button id="btncollapse-results-box">hide</button></h3>
<div id="results-box">
<div id="paging"></div><br>
<div id="paging"></div>
<div id="paging-item">
<button onclick="{view.js}.execute({prev_page},{items_per_page})">PREV</button>
<button onclick="{view.js}.execute({next_page},{items_per_page})">NEXT</button>
<button class="btn mid" onclick="
{view.js}.execute({prev_page},{items_per_page})"
><i class="fa fa-chevron-left fa-fw"></i></button>
<button class="btn mid" onclick="
{view.js}.execute({next_page},{items_per_page})"
><i class="fa fa-chevron-right fa-fw"></i></button>
<span>{current_page} / {total_pages} ({total_users} users)</span>
</div>
<div id="users-all"></div>

View File

@ -198,7 +198,6 @@ window.view.instance = {
return html;
});
E.template('paging', function(TPL) {
var html = '';
var tpl = TPL;
if (js['paging']['total_pages'] === 0)
js['paging']['total_pages'] = 1;
@ -215,7 +214,7 @@ window.view.instance = {
tpl = tpl.replaceAll('{items_per_page}', items_per_page);
tpl = tpl.replaceAll('{total_pages}', js['paging']['total_pages']);
tpl = tpl.replaceAll('{total_users}', js['total']);
return tpl;
return tpl+'<br>';
});
});
},