Skip to content

Commit

Permalink
Fixes netbox-community#463: Prevent prepopulation of livesearch field…
Browse files Browse the repository at this point in the history
… with '---------'
  • Loading branch information
jeremystretch committed Aug 12, 2016
1 parent d07b820 commit 7600a46
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions netbox/project-static/js/livesearch.js
Original file line number Diff line number Diff line change
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 7600a46

Please sign in to comment.