mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 01:33:03 +00:00
add postal code field, fixes #1292
This commit is contained in:
13
css/app.css
13
css/app.css
@@ -1302,7 +1302,7 @@ input[type=number] {
|
||||
}
|
||||
|
||||
.form-field .addr-number {
|
||||
width: 20%;
|
||||
width: 33%;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
border-bottom: 0;
|
||||
@@ -1310,19 +1310,26 @@ input[type=number] {
|
||||
}
|
||||
|
||||
.form-field .addr-street {
|
||||
width: 80%;
|
||||
width: 66%;
|
||||
border-right: 0;
|
||||
border-bottom: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.form-field .addr-city {
|
||||
width: 66%;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
border-bottom: 0;
|
||||
border-radius: 0 0 4px 4px;
|
||||
border-radius: 0 0 0 4px;
|
||||
}
|
||||
|
||||
.form-field .addr-postcode {
|
||||
width: 33%;
|
||||
border-right: 0;
|
||||
border-bottom: 0;
|
||||
border-radius: 0 0 4px 0;
|
||||
}
|
||||
/* combobox dropdown */
|
||||
|
||||
div.combobox {
|
||||
|
||||
@@ -375,7 +375,8 @@ locale.en = {
|
||||
"housename": "Housename",
|
||||
"number": "123",
|
||||
"street": "Street",
|
||||
"city": "City"
|
||||
"city": "City",
|
||||
"postcode": "Postal code"
|
||||
}
|
||||
},
|
||||
"admin_level": {
|
||||
|
||||
@@ -46,6 +46,7 @@ en:
|
||||
number: "123"
|
||||
street: Street
|
||||
city: City
|
||||
postcode: Postal code
|
||||
admin_level:
|
||||
label: Admin Level
|
||||
aeroway:
|
||||
|
||||
@@ -51,7 +51,8 @@
|
||||
"addr:housename",
|
||||
"addr:housenumber",
|
||||
"addr:street",
|
||||
"addr:city"
|
||||
"addr:city",
|
||||
"addr:postcode"
|
||||
],
|
||||
"icon": "address",
|
||||
"universal": true,
|
||||
@@ -61,7 +62,8 @@
|
||||
"housename": "Housename",
|
||||
"number": "123",
|
||||
"street": "Street",
|
||||
"city": "City"
|
||||
"city": "City",
|
||||
"postcode": "Postal code"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
"addr:housename",
|
||||
"addr:housenumber",
|
||||
"addr:street",
|
||||
"addr:city"
|
||||
"addr:city",
|
||||
"addr:postcode"
|
||||
],
|
||||
"icon": "address",
|
||||
"universal": true,
|
||||
@@ -14,7 +15,8 @@
|
||||
"housename": "Housename",
|
||||
"number": "123",
|
||||
"street": "Street",
|
||||
"city": "City"
|
||||
"city": "City",
|
||||
"postcode": "Postal code"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user