- $.ajax({
- url: url,
- type: method,
- oauth: true,
- data: {text: $(form.text).val()},
- success: function (feature) {
- marker = noteLayer.getLayer(marker);
- if (feature.properties.status == "hidden") {
- noteLayer.removeLayer(marker);
- } else {
- marker.setIcon(noteIcons[feature.properties.status]);
- page.load();
- }
- }
- });
- }
-
- function bind() {
- content.find("input[type=submit]").on("click", function (e) {
- e.preventDefault();
- var data = $(e.target).data();
- updateNote(data.noteId, e.target.form, data.method, data.url);
- });
+ $.ajax({
+ url: url,
+ type: method,
+ oauth: true,
+ data: {text: $(form.text).val()},
+ success: function (feature) {
+ marker = noteLayer.getLayer(marker);
+ if (feature.properties.status == "hidden") {
+ noteLayer.removeLayer(marker);
+ } else if (marker) {
+ marker.setIcon(noteIcons[feature.properties.status]);
+ }
+ page.load();
+ }
+ });
+ }