From ba774bd16efd9071af6b09334206a6a76ff5e4dc Mon Sep 17 00:00:00 2001 From: Martin Potier Date: Mon, 14 Sep 2015 15:06:08 +0200 Subject: [PATCH] TODO item 11. --- Readme.md | 3 ++- cherche.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index 23dd2f8..6a304b9 100644 --- a/Readme.md +++ b/Readme.md @@ -19,7 +19,8 @@ Todo (sorted by priority) ------------------------- 1. ~~Make the search case-insensitive (as well as accents insensitive)~~ - 11. BUG: trim spaces from search expression + 11. ~~BUG: trim spaces from search expression~~ + 12. BUG: fix search for codes also 2. Create a nice html page (may take several steps) 3. Make it chrome compatible (some trouble with the first ajax call) 4. Make the search mis-spelling safe (like Google does) diff --git a/cherche.js b/cherche.js index b254f06..12d6624 100644 --- a/cherche.js +++ b/cherche.js @@ -211,7 +211,7 @@ function main() { //console.log(words.data); $( "#question" ).keyup(function () { var str = removeDiacritics($( "#question" ).val()); - var ans = words.find({'Word': { '$contains': str}}); + var ans = words.find({'Word': { '$contains': str.trim()}}); //console.log("Words found: ",ans); //console.log(displayMany(ans)); $( "#answer" ).empty().append(displayMany(ans));