Skip to content

Commit

Permalink
Merge pull request #34 from tjikkun/develop
Browse files Browse the repository at this point in the history
FIX suggestion of ip when subnet id is not the same as array index
  • Loading branch information
ohadlevy committed Apr 17, 2012
2 parents 96ede45 + ba30302 commit dfcfbae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/javascripts/host_edit.js
Expand Up @@ -123,9 +123,9 @@ function subnet_selected(element){
if (subnet_id == '' || $('#host_ip').size() == 0) return false; if (subnet_id == '' || $('#host_ip').size() == 0) return false;
// We do not query the proxy if the host_ip field is filled in and contains an // We do not query the proxy if the host_ip field is filled in and contains an
// IP that is in the selected subnet // IP that is in the selected subnet
var drop_text = $(element).text().split("\n")[subnet_id] var drop_text = $(element).children(":selected").text();
if (drop_text.length !=0 && drop_text.search(/^.+ \([0-9\.\/]+\)/) != -1) { if (drop_text.length !=0 && drop_text.search(/^.+ \([0-9\.\/]+\)/) != -1) {
var details = $(element).text().split("\n")[subnet_id].replace(/^[^(]+\(/, "").replace(")","").split("/"); var details = drop_text.replace(/^[^(]+\(/, "").replace(")","").split("/");
if (subnet_contains(details[0], details[1], $('#host_ip').val())) if (subnet_contains(details[0], details[1], $('#host_ip').val()))
return false; return false;
} }
Expand Down

0 comments on commit dfcfbae

Please sign in to comment.