Last active
September 4, 2015 19:03
-
-
Save actuosus/cc77f3621ad5663640a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: public/js/views/search_facet.js | |
=================================================================== | |
--- public/js/views/search_facet.js (revision ) | |
+++ public/lib/js/views/search_facet.js (revision ) | |
@@ -167,7 +167,7 @@ | |
resp(matches); | |
} else { | |
var re = VS.utils.inflector.escapeRegExp(searchTerm || ''); | |
- var matcher = new RegExp('\\b' + re, 'i'); | |
+ var matcher = new RegExp('[^a-zA-Zа-яА-ЯёЁ]' + re, 'i'); | |
matches = $.grep(matches, function(item) { | |
return matcher.test(item) || | |
matcher.test(item.value) || |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: public/js/views/search_input.js | |
=================================================================== | |
--- public/js/views/search_input.js (revision ) | |
+++ public/lib/js/views/search_input.js (revision ) | |
@@ -101,7 +101,7 @@ | |
// `facetMatches` callback to skip any further ordering done client-side. | |
autocompleteValues : function(req, resp) { | |
var searchTerm = req.term; | |
- var lastWord = searchTerm.match(/\w+\*?$/); // Autocomplete only last word. | |
+ var lastWord = searchTerm.match(/[a-zA-Zа-яА-ЯёЁ]+\*?$/); // Autocomplete only last word. | |
var re = VS.utils.inflector.escapeRegExp(lastWord && lastWord[0] || ''); | |
this.app.options.callbacks.facetMatches(function(prefixes, options) { | |
options = options || {}; | |
@@ -178,7 +178,7 @@ | |
var matcher = new RegExp(lastWord[0], "i"); | |
if (facetValue.search(matcher) == 0) { | |
- boxValue = boxValue.replace(/\b(\w+)$/, ''); | |
+ boxValue = boxValue.replace(/\b([a-zA-Zа-яА-ЯёЁ]+)$/, ''); | |
} | |
boxValue = boxValue.replace('^\s+|\s+$', ''); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment