- if ($(e.target).val() == "") {
- $(form.close).val(I18n.t("javascripts.notes.show.close"));
- $(form.comment).prop("disabled", true);
- } else {
- $(form.close).val(I18n.t("javascripts.notes.show.comment_and_close"));
- $(form.comment).prop("disabled", false);
- }
- });
-
- content.find("input[type=submit]").on("click", function (e) {
- e.preventDefault();
- updateNote(marker, e.target.form, $(e.target).data("url"));
- });
-
- return content[0];
- }
-
- function createNote(marker, form, url) {
- var location = marker.getLatLng();
-
- $(form).find("input[type=submit]").prop("disabled", true);
-
- $.ajax({
- url: url,
- type: "POST",
- data: {
- lat: location.lat,
- lon: location.lng,
- text: $(form.text).val()
- },
- success: function (feature) {
+ function updateMarkers(feature) {
+ var marker = oldNotes[feature.properties.id];
+ delete oldNotes[feature.properties.id];