mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-26 14:00:31 +01:00
misc preset
This commit is contained in:
@@ -785,6 +785,7 @@ div.combobox {
|
||||
}
|
||||
|
||||
.grid-entry .preset-help {
|
||||
display:none;
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
right: 0px;
|
||||
|
||||
@@ -16,7 +16,7 @@ iD.presets.Preset = function(preset, forms) {
|
||||
var tags = preset.match.tags;
|
||||
for (var t in tags) {
|
||||
if (entity.tags[t] !== tags[t] &&
|
||||
(tags[t] !== '*' || t in entity.tags)) return -1;
|
||||
!(tags[t] === '*' && t in entity.tags)) return -1;
|
||||
}
|
||||
return Object.keys(preset.match.tags).length;
|
||||
};
|
||||
|
||||
@@ -28,15 +28,15 @@ iD.ui.PresetGrid = function(context) {
|
||||
.attr('type', 'search')
|
||||
.on('keyup', function() {
|
||||
// enter
|
||||
if (d3.event.keyCode === 13) {
|
||||
var value = search.property('value');
|
||||
if (d3.event.keyCode === 13 && value.length) {
|
||||
choose(grid.selectAll('.grid-entry:first-child').datum());
|
||||
} else {
|
||||
var value = search.property('value');
|
||||
grid.classed('filtered', value.length);
|
||||
if (value.length) {
|
||||
var results = presets.search(value);
|
||||
message.text(t('inspector.results', {n: results.length, search: value}));
|
||||
message.text(t('inspector.results', {n: results.collection.length, search: value}));
|
||||
grid.call(drawGrid, results);
|
||||
grid.classed('filtered', value.length);
|
||||
} else {
|
||||
grid.call(drawGrid, context.presets().defaults(entity));
|
||||
}
|
||||
|
||||
@@ -37,6 +37,11 @@
|
||||
"key": "building",
|
||||
"type": "combo"
|
||||
},
|
||||
"building_yes": {
|
||||
"key": "building",
|
||||
"type": "combo",
|
||||
"default": { "area": "yes" }
|
||||
},
|
||||
"fee": {
|
||||
"key": "fee",
|
||||
"type": "select",
|
||||
|
||||
@@ -300,7 +300,15 @@
|
||||
"form": ["oneway", "access", "maxspeed"]
|
||||
},
|
||||
{
|
||||
"title": "Basketball court",
|
||||
"name": "sport pitch",
|
||||
"match": {
|
||||
"type": ["point", "area"],
|
||||
"tags": { "leisure": "pitch" }
|
||||
},
|
||||
"icon": "pitch",
|
||||
"form": ["surface"]
|
||||
},
|
||||
{
|
||||
"name": "basketball court",
|
||||
"match": {
|
||||
"type": ["point", "area"],
|
||||
@@ -312,6 +320,42 @@
|
||||
"icon": "basketball",
|
||||
"form": ["surface"]
|
||||
},
|
||||
{
|
||||
"name": "baseball diamond",
|
||||
"match": {
|
||||
"type": ["point", "area"],
|
||||
"tags": {
|
||||
"leisure": "pitch",
|
||||
"sport": "baseball"
|
||||
}
|
||||
},
|
||||
"icon": "baseball",
|
||||
"form": ["surface"]
|
||||
},
|
||||
{
|
||||
"name": "soccer field",
|
||||
"match": {
|
||||
"type": ["point", "area"],
|
||||
"tags": {
|
||||
"leisure": "pitch",
|
||||
"sport": "soccer"
|
||||
}
|
||||
},
|
||||
"icon": "soccer",
|
||||
"form": ["surface"]
|
||||
},
|
||||
{
|
||||
"name": "tennis court",
|
||||
"match": {
|
||||
"type": ["point", "area"],
|
||||
"tags": {
|
||||
"leisure": "pitch",
|
||||
"sport": "tennis"
|
||||
}
|
||||
},
|
||||
"icon": "tennis",
|
||||
"form": ["surface"]
|
||||
},
|
||||
{
|
||||
"title": "Building",
|
||||
"name": "building",
|
||||
@@ -322,6 +366,6 @@
|
||||
}
|
||||
},
|
||||
"icon": "warehouse",
|
||||
"form": ["building", "address"]
|
||||
"form": ["building_yes", "address"]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user