From 985768867f16fb8ca054ae26e010e704fff29014 Mon Sep 17 00:00:00 2001 From: Tomas Kirda Date: Fri, 7 Jun 2013 18:37:01 -0500 Subject: [PATCH] Update demo script. --- scripts/demo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/demo.js b/scripts/demo.js index cb4f2e0..b49d4b2 100644 --- a/scripts/demo.js +++ b/scripts/demo.js @@ -20,7 +20,7 @@ $(function () { response: function (settings) { var query = settings.data.query, queryLowerCase = query.toLowerCase(), - re = new RegExp('\\b' + queryLowerCase, 'gi'), + re = new RegExp('\\b' + $.Autocomplete.utils.escapeRegExChars(queryLowerCase), 'gi'), suggestions = $.grep(countriesArray, function (country) { // return country.value.toLowerCase().indexOf(queryLowerCase) === 0; return re.test(country.value); @@ -39,7 +39,7 @@ $(function () { // serviceUrl: '/autosuggest/service/url', lookup: countriesArray, lookupFilter: function(suggestion, originalQuery, queryLowerCase) { - var re = new RegExp('\\b' + queryLowerCase, 'gi'); + var re = new RegExp('\\b' + $.Autocomplete.utils.escapeRegExChars(queryLowerCase), 'gi'); return re.test(suggestion.value); }, onSelect: function(suggestion) {