diff --git a/pkg/networkmanager/interfaces.js b/pkg/networkmanager/interfaces.js index 344076736e85..d98e92d360e7 100644 --- a/pkg/networkmanager/interfaces.js +++ b/pkg/networkmanager/interfaces.js @@ -3215,9 +3215,11 @@ PageNetworkIpSettings.prototype = { var auto_dns_search_btn, dns_search_table; var auto_routes_btn, routes_table; - function choicebox(p, choices) { + function choicebox(p, choices, callback) { var btn = select_btn( function (choice) { + if (callback) + callback(choice); params[p] = choice; self.update(); }, @@ -3320,8 +3322,13 @@ PageNetworkIpSettings.prototype = { $('
').append( addresses_table = tablebox(_("Addresses"), "addresses", [ "Address", prefix_text, "Gateway" ], [ "", "", "" ], - choicebox("method", (topic == "ipv4") - ? ipv4_method_choices : ipv6_method_choices) + choicebox("method", + (topic == "ipv4") ? ipv4_method_choices : ipv6_method_choices, + function (method) { + if (method == "auto") { + params.addresses = [ ]; + } + }) .css('display', 'inline-block')), $('
'), dns_table =