From b121df6945ae827a35106171d2a7ee6741c17763 Mon Sep 17 00:00:00 2001 From: Jake Harding Date: Fri, 7 Feb 2014 21:34:40 -0800 Subject: [PATCH] Support passing array of datasets to initialize. Closes #664. --- src/typeahead/plugin.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/typeahead/plugin.js b/src/typeahead/plugin.js index 29badfb1..057cc410 100644 --- a/src/typeahead/plugin.js +++ b/src/typeahead/plugin.js @@ -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 || {};