Use "none" as cycleway field placeholder

Ensure "no" is not saved to OSM
This commit is contained in:
Eric Brelsford
2015-06-09 15:15:48 -04:00
parent 31c57c01ce
commit a5dfee71b1
5 changed files with 13 additions and 20 deletions

View File

@@ -259,8 +259,8 @@ en:
lane:
description: A bike lane separated from auto traffic by a painted line
title: Standard bike lane
# no=yes
'no':
# none=yes
none:
description: No bike lane
title: None
# opposite=yes
@@ -284,7 +284,7 @@ en:
description: A bike lane separated from traffic by a physical barrier
title: Bike track
# cycleway field placeholder
placeholder: 'lane, shared lane'
placeholder: none
types:
cycleway: Both sides
'cycleway:left': Left side

View File

@@ -332,7 +332,7 @@
},
"type": "cycleway",
"label": "Bike Lanes",
"placeholder": "lane, shared lane",
"placeholder": "none",
"strings": {
"types": {
"cycleway": "Both sides",
@@ -340,7 +340,7 @@
"cycleway:right": "Right side"
},
"options": {
"no": {
"none": {
"title": "None",
"description": "No bike lane"
},

View File

@@ -3,7 +3,7 @@
"reference": {"key": "cycleway"},
"type": "cycleway",
"label": "Bike Lanes",
"placeholder": "lane, shared lane",
"placeholder": "none",
"strings": {
"types": {
"cycleway": "Both sides",
@@ -11,7 +11,7 @@
"cycleway:right": "Right side"
},
"options": {
"no": {
"none": {
"title": "None",
"description": "No bike lane"
},

View File

@@ -788,14 +788,14 @@
},
"cycleway": {
"label": "Bike Lanes",
"placeholder": "lane, shared lane",
"placeholder": "none",
"types": {
"cycleway": "Both sides",
"cycleway:left": "Left side",
"cycleway:right": "Right side"
},
"options": {
"no": {
"none": {
"title": "None",
"description": "No bike lane"
},

View File

@@ -45,11 +45,14 @@ iD.ui.preset.cycleway = function(field) {
function change(d) {
var tag = {};
tag[d] = d3.select(this).value() || undefined;
if (tag[d] === 'none') {
tag[d] = undefined;
}
event.change(tag);
}
cycleway.options = function() {
var options = ['no', 'lane', 'shared_lane', 'track', 'share_busway', 'opposite_lane', 'opposite'];
var options = ['none', 'lane', 'shared_lane', 'track', 'share_busway', 'opposite_lane', 'opposite'];
return options.map(function(option) {
return {
@@ -65,16 +68,6 @@ iD.ui.preset.cycleway = function(field) {
.attr('placeholder', function() {
return tags.cycleway ? tags.cycleway : field.placeholder();
});
items.selectAll('#preset-input-cycleway-cycleway')
.attr('placeholder', 'no');
// Remove "no" values
_.forEach(tags, function (value, key) {
if (key.indexOf('cycleway') === 0 && value === 'no') {
delete tags[key];
}
});
};
cycleway.focus = function() {