Commit 4a7515c4 by Őry Máté

network: related field if changed by magic

parent 435f4556
......@@ -28,6 +28,17 @@ function getURLParameter(name) {
);
}
function doBlink(id, count) {
if (count > 0) {
$(id).parent().delay(200).queue(function() {
$(this).delay(200).queue(function() {
$(this).removeClass("has-warning").dequeue();
doBlink(id, count-1);});
$(this).addClass("has-warning").dequeue()
});
}
}
$(function() {
$("[title]").tooltip();
......@@ -44,9 +55,10 @@ $("#ipv4-magic").click(function() {
data: {vlan: $("[name=vlan]").val()},
success: function(data) {
$("[name=ipv4]").val(data["ipv4"]);
if (!$("[name=ipv6]").val()) {
$("[name=ipv6]").val(data["ipv6"]);
if ($("[name=ipv6]").val() != data["ipv6"]) {
doBlink("[name=ipv6]", 3);
}
$("[name=ipv6]").val(data["ipv6"]);
}});
});
$("#ipv6-tpl-magic").click(function() {
......@@ -55,6 +67,10 @@ $("#ipv6-tpl-magic").click(function() {
network6: $("[name=network6]").val()},
success: function(data) {
$("[name=ipv6_template]").val(data["ipv6_template"]);
if ($("[name=host_ipv6_prefixlen]").val() != data["host_ipv6_prefixlen"]) {
doBlink("[name=host_ipv6_prefixlen]", 3);
}
$("[name=host_ipv6_prefixlen]").val(data["host_ipv6_prefixlen"]);
}});
});
});
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