Replace uses of var with let or const as appropriate

This commit is contained in:
Tom Hughes 2025-01-26 19:06:27 +00:00
parent f83424aeb2
commit c47cb299a8
36 changed files with 427 additions and 430 deletions

View file

@ -1,11 +1,11 @@
L.OSM.query = function (options) {
var control = L.control(options);
const control = L.control(options);
control.onAdd = function (map) {
var $container = $("<div>")
const $container = $("<div>")
.attr("class", "control-query");
var link = $("<a>")
const link = $("<a>")
.attr("class", "control-button")
.attr("href", "#")
.html("<span class=\"icon query\"></span>")
@ -14,8 +14,8 @@ L.OSM.query = function (options) {
map.on("zoomend", update);
function update() {
var wasDisabled = link.hasClass("disabled"),
isDisabled = map.getZoom() < 14;
const wasDisabled = link.hasClass("disabled"),
isDisabled = map.getZoom() < 14;
link
.toggleClass("disabled", isDisabled)
.attr("data-bs-original-title", I18n.t(isDisabled ?