summaryrefslogtreecommitdiffstats
path: root/module/web/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'module/web/static/js')
-rw-r--r--module/web/static/js/views/filterView.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/module/web/static/js/views/filterView.js b/module/web/static/js/views/filterView.js
index ea0aff0d5..19501430a 100644
--- a/module/web/static/js/views/filterView.js
+++ b/module/web/static/js/views/filterView.js
@@ -29,7 +29,7 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes'],
$.fn.typeahead.Constructor.prototype.show = show;
this.$('.search-query').typeahead({
minLength: 2,
- source: this.getAutocompletion
+ source: this.getSuggestions
});
this.stateMenu = this.$('.dropdown-toggle .state');
@@ -43,10 +43,15 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes'],
return this;
},
- getAutocompletion: function() {
- return ["static", "autocompletion", "demo", "with", "some", "keywords",
- "a very long proposal for autocompletion", "autobot",
- "a very long proposal for autocompletion second one"];
+ getSuggestions: function(query, callback) {
+ console.log(callback);
+ $.ajax('/api/searchSuggestions', {
+ method: 'POST',
+ data: {pattern: JSON.stringify(query)},
+ success: function(data) {
+ callback(data);
+ }
+ });
},
switch_filter: function(e) {