if (marker)
{
marker.setIcon(noteIcons[feature.properties.status]);
- marker._popup.setContent(createPopupContent(marker, feature.properties));
+ marker._popup.setContent(createPopupContent(
+ marker, feature.properties,
+ $(marker._popup._content).find("textarea").val()
+ ));
}
else
{
};
}
- function createPopupContent(marker, properties) {
+ function createPopupContent(marker, properties, comment) {
var content = $(JST["templates/notes/show"]({ note: properties }));
content.find("textarea").on("input", function (e) {
updateNote(marker, e.target.form, data.method, data.url);
});
+ if (comment) {
+ content.find("textarea").val(comment).trigger("input");
+ }
+
return content[0];
}