Fixed autocomplete resetting if list didn't change

This commit is contained in:
Marcin Kurczewski 2014-10-18 14:32:29 +02:00
parent e6fc010897
commit c6d5a130e4
2 changed files with 4 additions and 2 deletions

1
TODO
View file

@ -1,7 +1,6 @@
This is transient file that lists functionalities to be implemented before
first major release.
- autocomplete: don't reset active item if suggestions stay the same
- autocomplete: don't show items that are already used in tag list (unsure)
- posts/upload: when adding multiple files, select first one, not last one
- posts/upload: better hotkeys for going to next post

View file

@ -166,6 +166,7 @@ App.Controls.AutoCompleteInput = function($input) {
}
function updateResults(textToFind) {
var oldResults = results.slice();
var source = getSource();
var filter = getResultsFilter(textToFind);
results = _.filter(source, filter);
@ -173,7 +174,9 @@ App.Controls.AutoCompleteInput = function($input) {
results = options.additionalFilter(results);
}
results = results.slice(0, options.maxResults);
activeResult = -1;
if (!_.isEqual(oldResults, results)) {
activeResult = -1;
}
}
function applyAutocomplete() {