diff --git a/tailbone/static/js/tailbone.js b/tailbone/static/js/tailbone.js index 5ac3c049..eac2ebd1 100644 --- a/tailbone/static/js/tailbone.js +++ b/tailbone/static/js/tailbone.js @@ -248,6 +248,24 @@ $(function() { }); + /* + * Whenever the "change" button is clicked within the context of an + * autocomplete field, hide the static display and show the autocomplete + * textbox. + */ + $('div.autocomplete-container button.autocomplete-change').click(function() { + var container = $(this).parents('div.autocomplete-container'); + var textbox = container.find('input.autocomplete-textbox'); + + container.find('input[type="hidden"]').val(''); + container.find('div.autocomplete-display').hide(); + + textbox.val(''); + textbox.show(); + textbox.select(); + textbox.focus(); + }); + /* * Add "check all" functionality to tables with checkboxes. */