luci-base: form.js: allow overriding empty section placeholder rendering
authorJo-Philipp Wich <jo@mein.io>
Thu, 8 Aug 2019 11:31:47 +0000 (13:31 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 14 Aug 2019 20:58:15 +0000 (22:58 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/form.js

index 3ddabea225cd1ae8fa23c1e8d6e9ff496c22ffd4..b8d97c751a89a00ea23d6d4c280c395be9b33a1e 100644 (file)
@@ -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());