addHalo(newNoteMarker.getLatLng());
newNoteMarker.on("dragend", function () {
- content.find("textarea").focus();
+ content.find("textarea").trigger("focus");
});
}
newNoteMarker = null;
}
- function moveNewNotMarkerToClick(e) {
+ function moveNewNoteMarkerToClick(e) {
if (newNoteMarker) newNoteMarker.setLatLng(e.latlng);
if (halo) halo.setLatLng(e.latlng);
- content.find("textarea").focus();
+ content.find("textarea").trigger("focus");
}
function updateControls() {
content.find("textarea")
.on("input", updateControls)
- .focus();
+ .attr("readonly", "readonly") // avoid virtual keyboard popping up on focus
+ .trigger("focus")
+ .removeAttr("readonly");
content.find("input[type=submit]").on("click", function (e) {
const location = newNoteMarker.getLatLng().wrap();
});
});
- map.on("click", moveNewNotMarkerToClick);
+ map.on("click", moveNewNoteMarkerToClick);
addNoteButton.on("disabled enabled", updateControls);
updateControls();
};
page.unload = function () {
- map.off("click", moveNewNotMarkerToClick);
+ map.off("click", moveNewNoteMarkerToClick);
addNoteButton.off("disabled enabled", updateControls);
removeNewNoteMarker();
addNoteButton.removeClass("active");