2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-11 18:02:28 +03:00

add jshint support + a few minor stylistic changes

This commit is contained in:
Jacob Thornton
2012-04-14 16:29:53 -07:00
parent 8575a45294
commit 575f18aaf4
29 changed files with 317 additions and 273 deletions
+10 -6
View File
@@ -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 );
}(window.jQuery);