add postal code field, fixes #1292

This commit is contained in:
Ansis Brammanis
2013-04-18 16:45:48 -04:00
parent 5ed5968b76
commit e893f686ca
6 changed files with 34 additions and 10 deletions
+12 -1
View File
@@ -5,6 +5,7 @@ iD.ui.preset.address = function(field, context) {
housenumber,
street,
city,
postcode,
entity;
function getStreets() {
@@ -76,6 +77,14 @@ iD.ui.preset.address = function(field, context) {
.on('blur', change)
.on('change', change)
.call(close());
postcode = wrap.append('input')
.property('type', 'text')
.attr('placeholder', field.t('placeholders.postcode'))
.attr('class', 'addr-postcode')
.on('blur', change)
.on('change', change)
.call(close());
}
function change() {
@@ -83,7 +92,8 @@ iD.ui.preset.address = function(field, context) {
'addr:housename': housename.property('value'),
'addr:housenumber': housenumber.property('value'),
'addr:street': street.property('value'),
'addr:city': city.property('value')
'addr:city': city.property('value'),
'addr:postcode': postcode.property('value')
});
}
@@ -98,6 +108,7 @@ iD.ui.preset.address = function(field, context) {
housenumber.property('value', tags['addr:housenumber'] || '');
street.property('value', tags['addr:street'] || '');
city.property('value', tags['addr:city'] || '');
postcode.property('value', tags['addr:postcode'] || '');
return address;
};