From aa594501bd24d51181dc3504602aa4aaefb1cb60 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Thu, 26 Jan 2012 23:16:02 -0800 Subject: change typeahead to data-source instead of data-data and add to docs --- js/bootstrap-typeahead.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'js') diff --git a/js/bootstrap-typeahead.js b/js/bootstrap-typeahead.js index 1205a99ca..82c318831 100644 --- a/js/bootstrap-typeahead.js +++ b/js/bootstrap-typeahead.js @@ -25,7 +25,7 @@ this.$element = $(element) this.options = $.extend({}, $.fn.typeahead.defaults, options) this.$menu = $(this.options.menu).appendTo('body') - this.data = this.options.data + this.source = this.options.source this.shown = false this.listen() } @@ -79,7 +79,7 @@ q = this.query.toLowerCase() - items = jQuery.grep(this.data, function (item) { + items = jQuery.grep(this.source, function (item) { if (that.matcher(item, q)) return item }) @@ -229,7 +229,8 @@ } $.fn.typeahead.defaults = { - items: 8 + source: [] + , items: 8 , menu: '' , item: '
  • ' } -- cgit v1.2.3