-//= require leaflet.locatecontrol/src/L.Control.Locate
+//= require leaflet.locatecontrol/dist/L.Control.Locate.umd
+
+(function () {
+ $(document).on("change", "#user_all", function () {
+ $("#user_list input[type=checkbox]").prop("checked", $("#user_all").prop("checked"));
+ });
+}());
$(document).ready(function () {
var defaultHomeZoom = 12;
map.on("click", function (e) {
if (!$("#updatehome").is(":checked")) return;
- var zoom = map.getZoom(),
- precision = OSM.zoomPrecision(zoom),
- location = e.latlng.wrap();
+ const [lat, lon] = OSM.cropLocation(e.latlng);
- $("#home_lat").val(location.lat.toFixed(precision));
- $("#home_lon").val(location.lng.toFixed(precision));
+ $("#home_lat").val(lat);
+ $("#home_lon").val(lon);
deleted_lat = null;
deleted_lon = null;
enableAuth();
}
- $("#user_all").change(function () {
- $("#user_list input[type=checkbox]").prop("checked", $("#user_all").prop("checked"));
- });
-
$("#content.user_confirm").each(function () {
$(this).hide();
$(this).find("#confirm").submit();