mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-22 00:07:03 +02:00
Avoid removing and re-adding address field (closes #2903)
This commit is contained in:
@@ -97,17 +97,18 @@ iD.ui.preset.address = function(field, context) {
|
||||
function address(selection) {
|
||||
isInitialized = false;
|
||||
|
||||
selection.selectAll('.preset-input-wrap')
|
||||
.remove();
|
||||
|
||||
var center = entity.extent(context.graph()).center(),
|
||||
addressFormat;
|
||||
wrap = selection.selectAll('.preset-input-wrap')
|
||||
.data([0]);
|
||||
|
||||
// Enter
|
||||
|
||||
wrap = selection.append('div')
|
||||
wrap.enter()
|
||||
.append('div')
|
||||
.attr('class', 'preset-input-wrap');
|
||||
|
||||
var center = entity.extent(context.graph()).center(),
|
||||
addressFormat;
|
||||
|
||||
iD.countryCode().search(center, function (err, countryCode) {
|
||||
addressFormat = _.find(iD.data.addressFormats, function (a) {
|
||||
return a && a.countryCodes && _.contains(a.countryCodes, countryCode);
|
||||
|
||||
Reference in New Issue
Block a user