Fixed autocomplete resetting if list didn't change
This commit is contained in:
parent
e6fc010897
commit
c6d5a130e4
2 changed files with 4 additions and 2 deletions
1
TODO
1
TODO
|
@ -1,7 +1,6 @@
|
||||||
This is transient file that lists functionalities to be implemented before
|
This is transient file that lists functionalities to be implemented before
|
||||||
first major release.
|
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)
|
- 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: when adding multiple files, select first one, not last one
|
||||||
- posts/upload: better hotkeys for going to next post
|
- posts/upload: better hotkeys for going to next post
|
||||||
|
|
|
@ -166,6 +166,7 @@ App.Controls.AutoCompleteInput = function($input) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateResults(textToFind) {
|
function updateResults(textToFind) {
|
||||||
|
var oldResults = results.slice();
|
||||||
var source = getSource();
|
var source = getSource();
|
||||||
var filter = getResultsFilter(textToFind);
|
var filter = getResultsFilter(textToFind);
|
||||||
results = _.filter(source, filter);
|
results = _.filter(source, filter);
|
||||||
|
@ -173,7 +174,9 @@ App.Controls.AutoCompleteInput = function($input) {
|
||||||
results = options.additionalFilter(results);
|
results = options.additionalFilter(results);
|
||||||
}
|
}
|
||||||
results = results.slice(0, options.maxResults);
|
results = results.slice(0, options.maxResults);
|
||||||
activeResult = -1;
|
if (!_.isEqual(oldResults, results)) {
|
||||||
|
activeResult = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyAutocomplete() {
|
function applyAutocomplete() {
|
||||||
|
|
Loading…
Reference in a new issue