mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-25 01:24:05 +02:00
Update country-coder to 2.0.0 (close #7029)
Localize address field in walkthrough without overwriting country coder function
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { dispatch as d3_dispatch } from 'd3-dispatch';
|
||||
import { select as d3_select, event as d3_event } from 'd3-selection';
|
||||
import * as countryCoder from 'country-coder';
|
||||
|
||||
import { t, textDirection } from '../../util/locale';
|
||||
import { dataPhoneFormats } from '../../../data';
|
||||
@@ -55,9 +56,9 @@ export function uiFieldText(field, context) {
|
||||
.on('change', change());
|
||||
|
||||
|
||||
if (field.type === 'tel' && services.countryCoder && _entity) {
|
||||
if (field.type === 'tel' && _entity) {
|
||||
var center = _entity.extent(context.graph()).center();
|
||||
var countryCode = services.countryCoder.iso1A2Code(center);
|
||||
var countryCode = countryCoder.iso1A2Code(center);
|
||||
var format = countryCode && dataPhoneFormats[countryCode.toLowerCase()];
|
||||
if (format) {
|
||||
wrap.selectAll('#' + fieldID)
|
||||
|
||||
Reference in New Issue
Block a user