commit 1d2b488bca0a6faea95d690a50157be56d73002e
parent b3d417164256c2d42507a659787744419fdb7bbb
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Fri, 7 Nov 2025 12:32:28 +0100
coordinates control: do not save on/off state in local storage
In most cases it is not needed to turn the control on in all the new tabs
when it is enabled in one.
Diffstat:
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/src/lib/leaflet.control.coordinates/index.js b/src/lib/leaflet.control.coordinates/index.js
@@ -104,7 +104,7 @@ L.Control.Coordinates = L.Control.extend({
this.loadStateFromStorage();
ko.applyBindings(this, container);
L.DomEvent.on(link, 'click', this.onClick, this);
-
+ this.setEnabled(false);
return container;
},
@@ -113,17 +113,11 @@ L.Control.Coordinates = L.Control.extend({
},
loadStateFromStorage: function() {
- const active = safeLocalStorage.leafletCoordinatesActive === '1';
const code = safeLocalStorage.leafletCoordinatesFmt || DEFAULT_FORMAT.code;
const elevationDisplayed = (safeLocalStorage.leafletCoordinatesDisplayElevation ?? '1') === '1';
this.formatCode(code);
this.displayElevation(elevationDisplayed);
- this.setEnabled(active);
- },
-
- saveEnabledStateToStorage: function() {
- safeLocalStorage.leafletCoordinatesActive = this.isEnabled() ? '1' : '0';
},
saveFormatStateToStorage: function() {
@@ -210,7 +204,6 @@ L.Control.Coordinates = L.Control.extend({
onClick: function() {
this.setEnabled(!this.isEnabled());
- this.saveEnabledStateToStorage();
},
onDisplayElevationChange: function(on) {