mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-14 21:28:11 +02:00
Make name field less of a special case
This commit is contained in:
+9
-11
@@ -912,18 +912,8 @@ a.selected:hover .toggle.icon { background-position: -40px -180px;}
|
||||
|
||||
.tag-wrap .grid-button-wrap .grid-entry .label {
|
||||
background: #eef0ff;
|
||||
}
|
||||
|
||||
.inspector-body .name {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.name input.major {
|
||||
padding-top: 35px;
|
||||
height: 70px;
|
||||
}
|
||||
|
||||
.inspector-body .name h4,
|
||||
.preset-field h4[for*="input-"] {
|
||||
border: 1px solid #cfcfcf;
|
||||
padding: 5px 10px;
|
||||
@@ -951,7 +941,15 @@ h4 + .preset-input input:first-child {
|
||||
.preset-field h4[for="input-building:levels"],
|
||||
.preset-field h4[for="input-ele"],
|
||||
.preset-field.checkselect h4 {
|
||||
right: 50%;}
|
||||
right: 50%;
|
||||
}
|
||||
|
||||
.preset-field-name h4 + input {
|
||||
padding-top: 35px;
|
||||
height: 70px;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* adding additional preset fields */
|
||||
|
||||
|
||||
@@ -135,10 +135,7 @@ en:
|
||||
no_documentation_key: There is no documentation available for this key
|
||||
show_more: Show More
|
||||
new_tag: New tag
|
||||
edit_tags: Edit tags
|
||||
okay: Okay
|
||||
view_on_osm: View on OSM
|
||||
name: Name
|
||||
editing_feature: "Editing {feature}"
|
||||
additional: Additional tags
|
||||
choose: Select feature type
|
||||
|
||||
@@ -345,6 +345,9 @@ locale.en = {
|
||||
"maxspeed": {
|
||||
"label": "Speed Limit"
|
||||
},
|
||||
"name": {
|
||||
"label": "Name"
|
||||
},
|
||||
"natural": {
|
||||
"label": "Natural"
|
||||
},
|
||||
|
||||
@@ -76,6 +76,8 @@ en:
|
||||
label: Type
|
||||
maxspeed:
|
||||
label: Speed Limit
|
||||
name:
|
||||
label: Name
|
||||
natural:
|
||||
label: Natural
|
||||
network:
|
||||
|
||||
@@ -196,6 +196,11 @@
|
||||
"type": "combo",
|
||||
"label": "Speed Limit"
|
||||
},
|
||||
"name": {
|
||||
"key": "name",
|
||||
"type": "text",
|
||||
"label": "Name"
|
||||
},
|
||||
"natural": {
|
||||
"key": "natural",
|
||||
"type": "combo",
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"key": "name",
|
||||
"type": "text",
|
||||
"label": "Name"
|
||||
}
|
||||
+4
-1
@@ -52,6 +52,10 @@ iD.presets = function(context) {
|
||||
return all;
|
||||
};
|
||||
|
||||
all.field = function(id) {
|
||||
return fields[id];
|
||||
};
|
||||
|
||||
all.universal = function() {
|
||||
return universal;
|
||||
};
|
||||
@@ -69,6 +73,5 @@ iD.presets = function(context) {
|
||||
return all;
|
||||
};
|
||||
|
||||
|
||||
return all;
|
||||
};
|
||||
|
||||
+8
-4
@@ -12,10 +12,14 @@ iD.ui.preset = function(context, entity) {
|
||||
keys = [];
|
||||
formwrap = selection.append('div');
|
||||
|
||||
var geometry = entity.geometry(context.graph());
|
||||
draw(formwrap, preset.fields.filter(function(f) {
|
||||
return f.matchGeometry(geometry);
|
||||
}));
|
||||
var geometry = entity.geometry(context.graph()),
|
||||
fields = preset.fields.filter(function(f) {
|
||||
return f.matchGeometry(geometry);
|
||||
});
|
||||
|
||||
fields.unshift(context.presets().field('name'));
|
||||
|
||||
draw(formwrap, fields);
|
||||
|
||||
var wrap = selection.append('div')
|
||||
.attr('class', 'col12 more-buttons inspector-inner');
|
||||
|
||||
+1
-18
@@ -2,7 +2,6 @@ iD.ui.TagEditor = function(context, entity) {
|
||||
var event = d3.dispatch('changeTags', 'choose', 'close'),
|
||||
presets = context.presets(),
|
||||
tags,
|
||||
name,
|
||||
preset,
|
||||
selection_,
|
||||
presetUI,
|
||||
@@ -58,21 +57,6 @@ iD.ui.TagEditor = function(context, entity) {
|
||||
var editorwrap = selection.append('div')
|
||||
.attr('class', 'tag-wrap inspector-body fillL2 inspector-body-' + geometry);
|
||||
|
||||
var namewrap = editorwrap.append('div')
|
||||
.attr('class', 'name fillL inspector-inner col12');
|
||||
|
||||
namewrap.append('h4')
|
||||
.text(t('inspector.name'));
|
||||
|
||||
name = namewrap.append('input')
|
||||
.attr('placeholder', 'unknown')
|
||||
.attr('class', 'major')
|
||||
.attr('type', 'text')
|
||||
.property('value', entity.tags.name || '')
|
||||
.on('blur', function() {
|
||||
changeTags({ name: name.property('value') });
|
||||
});
|
||||
|
||||
presetUI = iD.ui.preset(context, entity)
|
||||
.preset(preset)
|
||||
.on('change', changeTags)
|
||||
@@ -127,9 +111,8 @@ iD.ui.TagEditor = function(context, entity) {
|
||||
return tageditor(selection_, newmatch);
|
||||
}
|
||||
|
||||
name.property('value', tags.name || '');
|
||||
presetUI.change(tags);
|
||||
var rendered = ['name']
|
||||
var rendered = []
|
||||
.concat(Object.keys(preset.tags))
|
||||
.concat(presetUI.rendered());
|
||||
tagList.tags(_.omit(tags, rendered));
|
||||
|
||||
Reference in New Issue
Block a user