tcrosen/twitter-bootstrap-typeahead — pull request #41 by VictorGarcia (2013-02-18 12:11:26+00:00)
Title: Passing the $element as context to itemSelected

With the current implementation it is not possible to access this.$element
from the itemSelected function. This comes handy when implementing
several typeaheads in the same page and you need to react in other elements
once the typeahead was selected. By using proxy we are passing the current
element in the context and it can be accessed as 'this' from within
itemSelected.

Example:
[...]
itemSelected: function (item) {
$(this).prev('input[type="hidden"]').val(item);
},
[...]