X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/f32aea6d1429ef55b7e5ec60bf83576cf76d85ed..b14965e4b211ad7eece9b8a77b984c140744dc8f:/app/assets/javascripts/index/changeset.js diff --git a/app/assets/javascripts/index/changeset.js b/app/assets/javascripts/index/changeset.js index caf40f6b6..d3e61270b 100644 --- a/app/assets/javascripts/index/changeset.js +++ b/app/assets/javascripts/index/changeset.js @@ -12,9 +12,10 @@ OSM.Changeset = function (map) { const changesetData = content.find("[data-changeset]").data("changeset"); changesetData.type = "changeset"; + var hashParams = OSM.parseHash(window.location.hash); initialize(); map.addObject(changesetData, function (bounds) { - if (!window.location.hash && bounds.isValid()) { + if (!hashParams.center && bounds.isValid()) { OSM.router.withoutMoveListener(function () { map.fitBounds(bounds); }); @@ -61,13 +62,9 @@ OSM.Changeset = function (map) { }); content.find("textarea").on("input", function (e) { - var form = e.target.form; - - if ($(e.target).val() === "") { - $(form.comment).prop("disabled", true); - } else { - $(form.comment).prop("disabled", false); - } + const form = e.target.form, + disabled = $(e.target).val() === ""; + form.comment.disabled = disabled; }); content.find("textarea").val("").trigger("input");