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:
parent
5b00931878
commit
489297deb9
19
js/base.php
19
js/base.php
|
@ -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('/','--');
|
||||
|
|
|
@ -176,5 +176,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="paging" class="bottom"></div>
|
||||
</div>
|
||||
<br>
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue