mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-24 17:14:04 +02:00
special case for 'other' preset
This commit is contained in:
+15
-3
@@ -1,7 +1,19 @@
|
||||
iD.presetData = function() {
|
||||
|
||||
var other = {
|
||||
name: 'other',
|
||||
title: 'Other',
|
||||
icon: 'marker-stroked',
|
||||
match: {
|
||||
tags: {},
|
||||
type: ['node', 'line', 'area']
|
||||
},
|
||||
form: []
|
||||
};
|
||||
|
||||
var presets = {},
|
||||
data = [],
|
||||
categories = {},
|
||||
data = [other],
|
||||
categories = [],
|
||||
defaults = {
|
||||
node: [],
|
||||
area: [],
|
||||
@@ -16,7 +28,7 @@ iD.presetData = function() {
|
||||
|
||||
presets.data = function(_) {
|
||||
if (!arguments.length) return data;
|
||||
data = _.presets;
|
||||
data = _.presets.concat([other]);
|
||||
categories = _.categories;
|
||||
defaults = _.defaults;
|
||||
return presets;
|
||||
|
||||
@@ -56,7 +56,8 @@ iD.ui.PresetGrid = function() {
|
||||
|
||||
return iD.util.editDistance(value, a.name) - iD.util.editDistance(value, b.name);
|
||||
}).filter(function(d) {
|
||||
return iD.util.editDistance(value, d.name) - d.name.length + value.length < 3;
|
||||
return iD.util.editDistance(value, d.name) - d.name.length + value.length < 3 ||
|
||||
d.name === 'other';
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+2
-21
@@ -13,7 +13,8 @@
|
||||
"form": [
|
||||
{
|
||||
"key": "cuisine",
|
||||
"type": "combo"
|
||||
"type": "combo",
|
||||
"indexed": true
|
||||
},
|
||||
{
|
||||
"key": "internet_access",
|
||||
@@ -645,26 +646,6 @@
|
||||
"title": "Address"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Other",
|
||||
"name": "other",
|
||||
"match": {
|
||||
"type": ["line", "area"],
|
||||
"tags": {}
|
||||
},
|
||||
"icon": "square-stroked",
|
||||
"form": []
|
||||
},
|
||||
{
|
||||
"title": "Other",
|
||||
"name": "other",
|
||||
"match": {
|
||||
"type": ["node"],
|
||||
"tags": {}
|
||||
},
|
||||
"icon": "marker-stroked",
|
||||
"form": []
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
Reference in New Issue
Block a user