1
0
Fork 0

fix(handleSelected): ensure we're calling setVal on the right object

Fix #51
This commit is contained in:
Sylvain UTARD 2015-12-24 10:20:15 +01:00
parent c0633e51bf
commit 31abbd7400

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;
}
}