mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-27 18:32:25 +02:00
Fix issue with toggling the locator overlay too quickly (close #7814)
This commit is contained in:
@@ -23,7 +23,7 @@ export function uiGeolocate(context) {
|
||||
|
||||
function click() {
|
||||
if (context.inIntro()) return;
|
||||
if (!_layer.enabled()) {
|
||||
if (!_layer.enabled() && !_locating.isShown()) {
|
||||
|
||||
// This timeout ensures that we still call finish() even if
|
||||
// the user declines to share their location in Firefox
|
||||
@@ -33,6 +33,7 @@ export function uiGeolocate(context) {
|
||||
// get the latest position even if we already have one
|
||||
navigator.geolocation.getCurrentPosition(success, error, _geolocationOptions);
|
||||
} else {
|
||||
_locating.close();
|
||||
_layer.enabled(null, false);
|
||||
updateButtonState();
|
||||
}
|
||||
|
||||
@@ -51,5 +51,10 @@ export function uiLoading(context) {
|
||||
};
|
||||
|
||||
|
||||
loading.isShown = () => {
|
||||
return _modalSelection && !_modalSelection.empty() && _modalSelection.node().parentNode;
|
||||
};
|
||||
|
||||
|
||||
return loading;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user