luci-base: form.js: allow overriding empty section placeholder rendering
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
a90bf384b2
commit
5628329434
1 changed files with 8 additions and 4 deletions
|
@ -707,6 +707,13 @@ var CBITypedSection = CBIAbstractSection.extend({
|
||||||
return createEl;
|
return createEl;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
renderSectionPlaceholder: function() {
|
||||||
|
return E([
|
||||||
|
E('em', _('This section contains no values yet')),
|
||||||
|
E('br'), E('br')
|
||||||
|
]);
|
||||||
|
},
|
||||||
|
|
||||||
renderContents: function(cfgsections, nodes) {
|
renderContents: function(cfgsections, nodes) {
|
||||||
var section_id = null,
|
var section_id = null,
|
||||||
config_name = this.uciconfig || this.map.config,
|
config_name = this.uciconfig || this.map.config,
|
||||||
|
@ -749,10 +756,7 @@ var CBITypedSection = CBIAbstractSection.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodes.length == 0)
|
if (nodes.length == 0)
|
||||||
L.dom.append(sectionEl, [
|
sectionEl.appendChild(this.renderSectionPlaceholder());
|
||||||
E('em', _('This section contains no values yet')),
|
|
||||||
E('br'), E('br')
|
|
||||||
]);
|
|
||||||
|
|
||||||
sectionEl.appendChild(this.renderSectionAdd());
|
sectionEl.appendChild(this.renderSectionAdd());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue