Trim the search string before using it to find matching titles

Firefox OS autocompletion adds a space after each word it autocompletes,
so the title search was failing when using that feature (or simply if
you type a space at the end of your search string)
This commit is contained in:
mossroy 2013-06-04 12:23:25 +02:00
parent 8b752aed89
commit a684fec345

View File

@ -125,7 +125,7 @@ define(function(require) {
*/
function searchTitlesFromPrefix(prefix) {
if (localArchive.titleFile) {
localArchive.findTitlesWithPrefix(prefix, populateDropDownListOfTitles);
localArchive.findTitlesWithPrefix(prefix.trim(), populateDropDownListOfTitles);
} else {
alert("Title file not set");
}