-
- newNote = L.marker(map.containerPointToLatLng(markerPosition), {
- icon: noteIcons["new"],
- opacity: 0.7,
- draggable: true
- });
-
- var popupContent = $(JST["templates/notes/new"]({ create_url: $(e.target).attr("href") }));
-
- popupContent.find("textarea").on("input", function (e) {
- var form = e.target.form;
-
- if ($(e.target).val() == "") {
- $(form.add).prop("disabled", true);
- } else {
- $(form.add).prop("disabled", false);
- }
- });
-
- popupContent.find("input[type=submit]").on("click", function (e) {
- e.preventDefault();
- createNote(newNote, e.target.form, $(e.target).data("url"));
- });
-
- newNote.addTo(noteLayer).bindPopup(popupContent[0], popupOptions()).openPopup();
-
- newNote.on("remove", function (e) {
- $("#createnoteanchor").removeClass("disabled").addClass("geolink");
- });
-
- newNote.on("dragstart", function (e) {
- $(newNote).stopTime("removenote");
- });
-
- newNote.on("dragend", function (e) {
- e.target.openPopup();
- });
- });
-});