Skip to content

Commit

Permalink
[marcojetson#2] added opts parameter to constructor to override def…
Browse files Browse the repository at this point in the history
…aults
  • Loading branch information
therebelrobot committed Aug 31, 2015
1 parent 2ea62f2 commit f8ed066
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/type-ahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
* @param {HTMLInputElement} element
* @param {Array} candidates
*/
var TypeAhead = function (element, candidates) {
var TypeAhead = function (element, candidates, opts) {
var typeAhead = this;
opts = opts || {};

typeAhead.element = element;

typeAhead.candidates = candidates || [];

typeAhead.list = new TypeAheadList(typeAhead);

this.minLength = 3;
this.minLength = opts.minLength || 3;

typeAhead.limit = 5;
typeAhead.limit = opts.limit || 5;

typeAhead.query = '';

Expand Down

0 comments on commit f8ed066

Please sign in to comment.