Skip to content

Commit

Permalink
Support passing array of datasets to initialize. Closes #664.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Harding committed Feb 8, 2014
1 parent f7164b2 commit b121df6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/typeahead/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
typeaheadKey = 'ttTypeahead';

methods = {
initialize: function initialize(o /*, splot of datasets */) {
var datasets = [].slice.call(arguments, 1);
// supported signatures:
// function(o, dataset, dataset, ...)
// function(o, [dataset, dataset, ...])
initialize: function initialize(o, datasets) {
datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1);

o = o || {};

Expand Down

0 comments on commit b121df6

Please sign in to comment.