Show alert on account home page if home location is not set

This commit is contained in:
Anton Khorev 2024-06-27 04:02:38 +03:00
parent 5c019cd2ee
commit ae89ed45e5
3 changed files with 26 additions and 7 deletions

View file

@ -12,17 +12,26 @@ OSM.Home = function (map) {
map.setSidebarOverlaid(true);
clearMarker();
OSM.router.withoutMoveListener(function () {
map.setView(OSM.home, 15, { reset: true });
});
marker = L.marker(OSM.home, {
icon: OSM.getUserIcon(),
title: I18n.t("javascripts.home.marker_title")
}).addTo(map);
if (OSM.home) {
OSM.router.withoutMoveListener(function () {
map.setView(OSM.home, 15, { reset: true });
});
marker = L.marker(OSM.home, {
icon: OSM.getUserIcon(),
title: I18n.t("javascripts.home.marker_title")
}).addTo(map);
} else {
$("#browse_status").html(
$("<div class='m-2 alert alert-warning'>").text(
I18n.t("javascripts.home.not_set")
)
);
}
};
page.unload = function () {
clearMarker();
$("#browse_status").empty();
};
return page;