@hlfan commented on this pull request.
> -
- if (mapParams.object) {
- params.set("id", mapParams.object.type + "/" + mapParams.object.id);
- mapParams = OSM.parseHash(location.hash);
- if (mapParams.center) {
- params.set("map", mapParams.zoom + "/" + mapParams.center.lat + "/" +
mapParams.center.lng);
- }
- } else if (id.data("lat") && id.data("lon")) {
- params.set("map", "16/" + id.data("lat") + "/" + id.data("lon"));
- } else {
- params.set("map", (mapParams.zoom || 17) + "/" + mapParams.lat + "/" +
mapParams.lon);
- }
+ if (id.data("configured") === false) {
+ alert(I18n.t("site.edit.id_not_configured"));
+ return;
+ }
I'm not that eager to have that early return, but in cases where the `else` is
waiting for 40 lines to surprise me, making me look for which `if` it refers
to, I'd rather get it out of the way first. But I can drop it if that's not
wanted.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5597#discussion_r1940521106
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/5597/review/2591762...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev