- $("#createnoteanchor").click(function (e) {
- e.preventDefault();
-
- if ($(e.target).hasClass("disabled")) return;
-
- map.addLayer(noteLayer);
-
- var marker = L.marker(map.getCenter(), {
- icon: noteIcons["new"],
- opacity: 0.7,
- draggable: true
- });
-
- var popupContent = $(JST["templates/notes/new"]({ create_url: $(e.target).attr("href") }));
-
- popupContent.find("input[type=submit]").on("click", function (e) {
- e.preventDefault();
- createNote(marker, e.target.form, $(e.target).data("url"));
- });
-
- marker.addTo(noteLayer).bindPopup(popupContent[0], popupOptions()).openPopup();
-
- $(".leaflet-popup-close-button").on("click.close", function (e) {
- map.removeLayer(marker);
- });
-
- marker.on("dragend", function (e) {
- e.target.openPopup();
- });
- });
-});