From 5628329434d1d766ce65cea0a3017c6755f17fd4 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 8 Aug 2019 13:31:47 +0200 Subject: [PATCH] luci-base: form.js: allow overriding empty section placeholder rendering Signed-off-by: Jo-Philipp Wich --- .../luci-base/htdocs/luci-static/resources/form.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js index 3ddabea22..b8d97c751 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()); -- 2.25.1