Fix #3214: Add autocomplete for saved searches.
* Autocomplete the `search:<label>` metatag. * Make label autocompletion do a prefix match instead of a substring match. Example: `search:ar` matches `artists`, not `characters`. This is how tags and most other things are autocompleted.
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
$(document).ready(function() {
|
||||
Danbooru.SavedSearch = {};
|
||||
|
||||
Danbooru.SavedSearch.initialize_all = function() {
|
||||
if ($("#c-saved-searches".length)) {
|
||||
Danbooru.sorttable($("#c-saved-searches table"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Danbooru.SavedSearch.labels = function(term) {
|
||||
return $.getJSON("/saved_searches/labels", {
|
||||
"search[label]": term + "*",
|
||||
"limit": 10
|
||||
});
|
||||
}
|
||||
|
||||
$(Danbooru.SavedSearch.initialize_all);
|
||||
|
||||
Reference in New Issue
Block a user