diff --git a/js/base.php b/js/base.php index dfc6855..e6b184f 100644 --- a/js/base.php +++ b/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('/','--'); diff --git a/js/templates/instance/filter-users.html b/js/templates/instance/filter-users.html index b1e4087..7430641 100644 --- a/js/templates/instance/filter-users.html +++ b/js/templates/instance/filter-users.html @@ -176,5 +176,6 @@ +