Commit 7e5a2690 by Kálmán Viktor

dashboard: clean up interface remove js

parent f2652904
...@@ -186,18 +186,7 @@ $(function() { ...@@ -186,18 +186,7 @@ $(function() {
success: function(re, textStatus, xhr) { success: function(re, textStatus, xhr) {
/* remove the html element */ /* remove the html element */
$('a[data-interface-pk="' + data.pk + '"]').closest("div").fadeOut(); $('a[data-interface-pk="' + data.pk + '"]').closest("div").fadeOut();
location.reload();
/* add the removed element to the list */
network_select = $('select[name="new_network_vlan"]');
name_html = (re.removed_network.managed ? "": "") + " " + re.removed_network.vlan;
option_html = '<option value="' + re.removed_network.vlan_pk + '">' + name_html + '</option>';
// if it's -1 then it's a dummy placeholder so we can use .html
if($("option", network_select)[0].value === "-1") {
network_select.html(option_html);
network_select.next("div").children("button").prop("disabled", false);
} else {
network_select.append(option_html);
}
}, },
error: function(xhr, textStatus, error) { error: function(xhr, textStatus, error) {
addMessage('Uh oh :(', 'danger') addMessage('Uh oh :(', 'danger')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment