optimize order of values of access fields (closes #8945)

This commit is contained in:
Martin Raifer
2022-02-03 18:46:42 +01:00
parent bafa72c9e3
commit fcd8a2b2e7
2 changed files with 20 additions and 8 deletions
+4
View File
@@ -43,11 +43,15 @@ _Breaking developer changes, which may affect downstream projects or sites that
#### :newspaper: News
* Drop legacy support for Internet Explorer 11 ([#8811])
#### :rocket: Presets
* Optimize order of values in dropdowns of `access` fields ([#8945])
#### :hammer: Development
* Switch build system to [esbuild](https://esbuild.github.io/) for much faster builds ([#8774], thanks [@ mbrzakovic] and [@bhousel])
[#8774]: https://github.com/openstreetmap/iD/pull/8774
[#8811]: https://github.com/openstreetmap/iD/issues/8811
[#8945]: https://github.com/openstreetmap/iD/issues/8945
# 2.20.4
##### 2022-Feb-03
+16 -8
View File
@@ -79,15 +79,23 @@ export function uiFieldAccess(field, context) {
access.options = function(type) {
var options = ['no', 'permissive', 'private', 'permit', 'destination', 'customers', 'unknown'];
var options = [
'yes',
'no',
'designated',
'permissive',
'destination',
'customers',
'private',
'permit',
'unknown'
];
if (type !== 'access') {
options.unshift('yes');
options.push('designated');
if (type === 'bicycle') {
options.push('dismount');
}
if (type === 'access') {
options = options.filter(v => v !== 'yes' && v !== 'designated');
}
if (type === 'bicycle') {
options.splice(options.length - 4, 0, 'dismount');
}
return options.map(function(option) {