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
+4 -11
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() {