Make name field less of a special case

This commit is contained in:
John Firebaugh
2013-03-21 15:24:42 -07:00
parent 9796d4027d
commit 0baaf1a3fd
9 changed files with 37 additions and 37 deletions
+9 -11
View File
@@ -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 */
-3
View File
@@ -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
+3
View File
@@ -345,6 +345,9 @@ locale.en = {
"maxspeed": {
"label": "Speed Limit"
},
"name": {
"label": "Name"
},
"natural": {
"label": "Natural"
},
+2
View File
@@ -76,6 +76,8 @@ en:
label: Type
maxspeed:
label: Speed Limit
name:
label: Name
natural:
label: Natural
network:
+5
View File
@@ -196,6 +196,11 @@
"type": "combo",
"label": "Speed Limit"
},
"name": {
"key": "name",
"type": "text",
"label": "Name"
},
"natural": {
"key": "natural",
"type": "combo",
+5
View File
@@ -0,0 +1,5 @@
{
"key": "name",
"type": "text",
"label": "Name"
}
+4 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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));