]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
make case lookahead case insensitive
authorJacob Thornton <jacobthornton@gmail.com>
Sun, 22 Jan 2012 05:46:47 +0000 (21:46 -0800)
committerJacob Thornton <jacobthornton@gmail.com>
Sun, 22 Jan 2012 05:46:47 +0000 (21:46 -0800)
js/bootstrap-typeahead.js

index b4957c3f611fac71b632eb50c206953496679c0c..16539fefbfcd6c6ef301bb99b875a51fcdd3c513 100644 (file)
@@ -35,7 +35,8 @@
     constructor: Typeahead
 
   , matcher: function (item, query) {
-      return ~item.indexOf(query)
+      // ;_; http://jsperf.com/asdfdfasdfa
+      return ~item.toLowerCase().indexOf(query.toLowerCase())
     }
 
   , select: function () {