Added auto completion to tag list presenter
This commit is contained in:
parent
06d7c19556
commit
24ce67b4ff
1 changed files with 1 additions and 10 deletions
|
@ -10,8 +10,6 @@ App.Presenters.TagListPresenter = function(
|
||||||
pagerPresenter,
|
pagerPresenter,
|
||||||
topNavigationPresenter) {
|
topNavigationPresenter) {
|
||||||
|
|
||||||
var KEY_RETURN = 13;
|
|
||||||
|
|
||||||
var $el = jQuery('#content');
|
var $el = jQuery('#content');
|
||||||
var $searchInput;
|
var $searchInput;
|
||||||
var templates = {};
|
var templates = {};
|
||||||
|
@ -78,8 +76,8 @@ App.Presenters.TagListPresenter = function(
|
||||||
function render() {
|
function render() {
|
||||||
$el.html(templates.list());
|
$el.html(templates.list());
|
||||||
$searchInput = $el.find('input[name=query]');
|
$searchInput = $el.find('input[name=query]');
|
||||||
$searchInput.keydown(searchInputKeyPressed);
|
|
||||||
$el.find('form').submit(searchFormSubmitted);
|
$el.find('form').submit(searchFormSubmitted);
|
||||||
|
App.Controls.AutoCompleteInput($searchInput);
|
||||||
softRender();
|
softRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,13 +86,6 @@ App.Presenters.TagListPresenter = function(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function searchInputKeyPressed(e) {
|
|
||||||
if (e.which !== KEY_RETURN) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
updateSearch();
|
|
||||||
}
|
|
||||||
|
|
||||||
function searchFormSubmitted(e) {
|
function searchFormSubmitted(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
updateSearch();
|
updateSearch();
|
||||||
|
|
Loading…
Reference in a new issue