From 575f18aaf49abb0289185f6409bee031947ccf69 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 14 Apr 2012 16:29:53 -0700 Subject: add jshint support + a few minor stylistic changes --- js/bootstrap-typeahead.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'js/bootstrap-typeahead.js') 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 '' + match + '' }) @@ -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 -- cgit v1.2.3