From: Jo-Philipp Wich Date: Thu, 8 Aug 2019 11:31:47 +0000 (+0200) Subject: luci-base: form.js: allow overriding empty section placeholder rendering X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5628329434d1d766ce65cea0a3017c6755f17fd4;p=project%2Fluci.git luci-base: form.js: allow overriding empty section placeholder rendering Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js index 3ddabea225..b8d97c751a 100644 --- a/modules/luci-base/htdocs/luci-static/resources/form.js +++ b/modules/luci-base/htdocs/luci-static/resources/form.js @@ -707,6 +707,13 @@ var CBITypedSection = CBIAbstractSection.extend({ return createEl; }, + renderSectionPlaceholder: function() { + return E([ + E('em', _('This section contains no values yet')), + E('br'), E('br') + ]); + }, + renderContents: function(cfgsections, nodes) { var section_id = null, config_name = this.uciconfig || this.map.config, @@ -749,10 +756,7 @@ var CBITypedSection = CBIAbstractSection.extend({ } if (nodes.length == 0) - L.dom.append(sectionEl, [ - E('em', _('This section contains no values yet')), - E('br'), E('br') - ]); + sectionEl.appendChild(this.renderSectionPlaceholder()); sectionEl.appendChild(this.renderSectionAdd());