mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-05 14:38:05 +02:00
Fix unintentional case sensitivity in preset search
This commit is contained in:
@@ -42,7 +42,7 @@ iD.presets.Collection = function(collection) {
|
||||
value = value.toLowerCase();
|
||||
|
||||
var leading_name = _.filter(collection, function(a) {
|
||||
return leading(a.name());
|
||||
return leading(a.name().toLowerCase());
|
||||
}),
|
||||
leading_terms = _.filter(collection, function(a) {
|
||||
return _.any(a.terms || [], leading);
|
||||
@@ -56,7 +56,7 @@ iD.presets.Collection = function(collection) {
|
||||
var levenstein_name = collection.map(function(a) {
|
||||
return {
|
||||
preset: a,
|
||||
dist: iD.util.editDistance(value, a.name())
|
||||
dist: iD.util.editDistance(value, a.name().toLowerCase())
|
||||
};
|
||||
}).filter(function(a) {
|
||||
return a.dist + Math.min(value.length - a.preset.name().length, 0) < 3;
|
||||
|
||||
Reference in New Issue
Block a user