Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:commadelimited/autoComplete.js
Browse files Browse the repository at this point in the history
  • Loading branch information
commadelimited committed Jun 19, 2012
2 parents c666392 + 12a4fb3 commit 076ab5d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions jqm.autoComplete-1.3.js
Expand Up @@ -80,6 +80,16 @@
return re.test(element_text);
});
buildItems($this, data, settings);
}
// Accept a function as source.
// Function needs to call the callback, which is the first parameter.
// source:function(text,callback) { mydata = [1,2]; callback(mydata); }
else if (typeof settings.source === 'function') {

settings.source(text,function(data){
buildItems($this, data, settings);
});

} else {
$.ajax({
type: settings.method,
Expand Down

0 comments on commit 076ab5d

Please sign in to comment.