Merge pull request #3256 from ysc3839/gridsection

luci-base: form.js: fix GridSection not using user-input name when add
This commit is contained in:
Jo-Philipp Wich 2019-11-03 17:55:09 +01:00 committed by GitHub
commit 740d07573b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1390,9 +1390,9 @@ var CBIGridSection = CBITableSection.extend({
CBIAbstractSection.prototype.tab.call(this, name, title, description); CBIAbstractSection.prototype.tab.call(this, name, title, description);
}, },
handleAdd: function(ev) { handleAdd: function(ev, name) {
var config_name = this.uciconfig || this.map.config, var config_name = this.uciconfig || this.map.config,
section_id = this.map.data.add(config_name, this.sectiontype); section_id = this.map.data.add(config_name, this.sectiontype, name);
this.addedSection = section_id; this.addedSection = section_id;
return this.renderMoreOptionsModal(section_id); return this.renderMoreOptionsModal(section_id);