summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-08-08 13:31:47 +0200
committerJo-Philipp Wich <jo@mein.io>2019-08-14 22:58:15 +0200
commit5628329434d1d766ce65cea0a3017c6755f17fd4 (patch)
tree41520b9c003bcd1753c8fefa8291cea9192df69b /modules
parenta90bf384b27afcb933509065441931d6d3beab2f (diff)
luci-base: form.js: allow overriding empty section placeholder rendering
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/form.js12
1 files 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());