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