luci-mod-network: reset bridge VLANs on cancelling modal dialog
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
7a781d9cd8
commit
bb3269945c
2 changed files with 8 additions and 1 deletions
|
@ -922,6 +922,9 @@ return baseclass.extend({
|
|||
|
||||
s.getOption('vlan_filtering').updateDefaultValue(s.section);
|
||||
|
||||
s.map.addedVLANs = s.map.addedVLANs || [];
|
||||
s.map.addedVLANs.push(section_id);
|
||||
|
||||
return this.redraw();
|
||||
}, this));
|
||||
};
|
||||
|
|
|
@ -1302,7 +1302,7 @@ return view.extend({
|
|||
nettools.addDeviceOptions(s, dev, isNew);
|
||||
};
|
||||
|
||||
s.handleModalCancel = function(/* ... */) {
|
||||
s.handleModalCancel = function(map /*, ... */) {
|
||||
var name = uci.get('network', this.addedSection, 'name')
|
||||
|
||||
uci.sections('network', 'bridge-vlan', function(bvs) {
|
||||
|
@ -1310,6 +1310,10 @@ return view.extend({
|
|||
uci.remove('network', bvs['.name']);
|
||||
});
|
||||
|
||||
if (map.addedVLANs)
|
||||
for (var i = 0; i < map.addedVLANs.length; i++)
|
||||
uci.remove('network', map.addedVLANs[i]);
|
||||
|
||||
return form.GridSection.prototype.handleModalCancel.apply(this, arguments);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue