diff options
author | Jacob Thornton <jacobthornton@gmail.com> | 2012-01-27 11:16:02 +0400 |
---|---|---|
committer | Jacob Thornton <jacobthornton@gmail.com> | 2012-01-27 11:16:02 +0400 |
commit | aa594501bd24d51181dc3504602aa4aaefb1cb60 (patch) | |
tree | e18731963c6017f7012dacc9822440a391fbb359 /js | |
parent | c63175dc1d41e2d26e50194a7e24cc0ea618446b (diff) |
change typeahead to data-source instead of data-data and add to docs
Diffstat (limited to 'js')
-rw-r--r-- | js/bootstrap-typeahead.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/js/bootstrap-typeahead.js b/js/bootstrap-typeahead.js index 1205a99caf..82c3188319 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: '<ul class="typeahead dropdown-menu"></ul>' , item: '<li><a href="#"></a></li>' } |