Fix cursor on foreign link field links, fixes #9992

This commit is contained in:
Ramith Kulal
2023-12-06 12:57:46 +01:00
committed by Martin Raifer
parent edb176f513
commit 179fa71cdf
2 changed files with 6 additions and 3 deletions
+3
View File
@@ -47,6 +47,7 @@ _Breaking developer changes, which may affect downstream projects or sites that
#### :bug: Bugfixes
* Show turn restriction editor also when there is only one possible "to" way, as there might exist restrictions with that way as _via_ ([#9983])
* Local photos: Fix bug which prevented the last image from being removed from the map when removed from the list
* Fix wrong mouse cursor on "foreign link" field buttons (for example in the Mapillary or Wikimedia Commons fields) ([#9992], thanks [@ramith-kulal])
#### :earth_asia: Localization
#### :hourglass: Performance
#### :mortar_board: Walkthrough / Help
@@ -55,6 +56,8 @@ _Breaking developer changes, which may affect downstream projects or sites that
[#9424]: https://github.com/openstreetmap/iD/pull/9424
[#9422]: https://github.com/openstreetmap/iD/issues/9422
[#9983]: https://github.com/openstreetmap/iD/issues/9983
[#9992]: https://github.com/openstreetmap/iD/issues/9992
[@ramith-kulal]: https://github.com/ramith-kulal
# 2.27.3
+3 -3
View File
@@ -171,11 +171,10 @@ export function uiFieldText(field, context) {
} else if (field.type === 'identifier' && field.urlFormat && field.pattern) {
input.attr('type', 'text');
outlinkButton = wrap.selectAll('.foreign-id-permalink')
.data([0]);
outlinkButton.enter()
outlinkButton = outlinkButton.enter()
.append('button')
.call(svgIcon('#iD-icon-out-link'))
.attr('class', 'form-field-button foreign-id-permalink')
@@ -187,9 +186,10 @@ export function uiFieldText(field, context) {
}
return '';
})
.merge(outlinkButton);
outlinkButton
.on('click', function(d3_event) {
d3_event.preventDefault();
var value = validIdentifierValueForLink();
if (value) {
var url = field.urlFormat.replace(/{value}/, encodeURIComponent(value));