1
0
Fork 0

Merge pull request #52 from algolia/fix/51

fix(handleSelected): ensure we're calling setVal on the right object
This commit is contained in:
Alex S 2015-12-24 11:06:07 +01:00
commit d6f80ae45c

View file

@ -58,7 +58,7 @@ class DocSearch {
footer: templates.footer
}
}]);
this.autocomplete.on('autocomplete:selected', this.handleSelected);
this.autocomplete.on('autocomplete:selected', this.handleSelected.bind(null, this.autocomplete.autocomplete));
}
/**
@ -161,8 +161,8 @@ class DocSearch {
};
}
handleSelected(event, suggestion) {
this.autocomplete.autocomplete.setVal('');
handleSelected(input, event, suggestion) {
input.setVal('');
window.location.href = suggestion.url;
}
}