Skip to content

Commit

Permalink
Fixes #463: Prevent prepopulation of livesearch field with '---------'
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Aug 12, 2016
1 parent 35aa8ac commit b74f338
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions netbox/project-static/js/livesearch.js
Expand Up @@ -8,9 +8,15 @@ $(document).ready(function() {
}

// Update livesearch text when real field changes
search_field.val(real_field.children('option:selected').text());
real_field.change(function() {
if (real_field.val()) {
search_field.val(real_field.children('option:selected').text());
}
real_field.change(function() {
if (real_field.val()) {
search_field.val(real_field.children('option:selected').text());
} else {
search_field.val('');
}
});

search_field.autocomplete({
Expand Down

0 comments on commit b74f338

Please sign in to comment.