diff options
| author | Mark Otto <[email protected]> | 2012-04-14 17:16:37 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2012-04-14 17:16:37 -0700 |
| commit | ce30d19c1507e71199f7dbbf680cf0d2b0ea6477 (patch) | |
| tree | 1279731abc8cf141a3fd683282ad2cae32ae6653 /js/bootstrap-typeahead.js | |
| parent | dbde2dc9e40f077af4fcaa1714ade7bc94398da9 (diff) | |
| parent | 3408064d00bc1e4322c3ea1575bc2cab5aaa2be2 (diff) | |
| download | bootstrap-ce30d19c1507e71199f7dbbf680cf0d2b0ea6477.tar.xz bootstrap-ce30d19c1507e71199f7dbbf680cf0d2b0ea6477.zip | |
Merge branch '2.0.3-wip' of github.com:twitter/bootstrap into 2.0.3-wip
Conflicts:
docs/assets/bootstrap.zip
Diffstat (limited to 'js/bootstrap-typeahead.js')
| -rw-r--r-- | js/bootstrap-typeahead.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/js/bootstrap-typeahead.js b/js/bootstrap-typeahead.js index 3876e6307..526cf320c 100644 --- a/js/bootstrap-typeahead.js +++ b/js/bootstrap-typeahead.js @@ -18,11 +18,15 @@ * ============================================================ */ -!function( $ ){ +!function($){ - "use strict" + "use strict"; // jshint ;_; - var Typeahead = function ( element, options ) { + + /* TYPEAHEAD PUBLIC CLASS DEFINITION + * ================================= */ + + var Typeahead = function (element, options) { this.$element = $(element) this.options = $.extend({}, $.fn.typeahead.defaults, options) this.matcher = this.options.matcher || this.matcher @@ -111,7 +115,7 @@ } , highlighter: function (item) { - var query = this.query.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') + var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&') return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) { return '<strong>' + match + '</strong>' }) @@ -241,7 +245,7 @@ /* TYPEAHEAD PLUGIN DEFINITION * =========================== */ - $.fn.typeahead = function ( option ) { + $.fn.typeahead = function (option) { return this.each(function () { var $this = $(this) , data = $this.data('typeahead') @@ -273,4 +277,4 @@ }) }) -}( window.jQuery );
\ No newline at end of file +}(window.jQuery);
\ No newline at end of file |
