Move autocompleter source instantiation to autocompleter code rather than application code

feature/core
Sven Slootweg 11 years ago
parent 9d88eee04a
commit 9c7ba13659

@ -251,7 +251,7 @@ AutoCompleterInstance.prototype.show = function() {
this.on("input.autocomplete_hook", function(){ this.on("input.autocomplete_hook", function(){
if(!$(this).data("attached-autocomplete")) if(!$(this).data("attached-autocomplete"))
{ {
var instance = autocompleter.spawn(source); var instance = autocompleter.spawn(new source($(this)));
instance.callback = callback; instance.callback = callback;
instance.attachBelow($(this)); instance.attachBelow($(this));
instance.hookKeyEvents($(this)); instance.hookKeyEvents($(this));

@ -289,7 +289,7 @@ $(function(){
autocompleter_search = new AutoCompleter("search"); autocompleter_search = new AutoCompleter("search");
$("#input_search_query").autoComplete(autocompleter_search, new SearchCompletionSource($("#input_search_query")), function(data){ $("#input_search_query").autoComplete(autocompleter_search, SearchCompletionSource, function(data){
openWindowNodeDetails(data.value); openWindowNodeDetails(data.value);
this.target.val(""); this.target.val("");
}); });

Loading…
Cancel
Save