- $.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();
- }
- }
- });
- }
+ page.pushstate = page.popstate = function (path) {
+ OSM.loadSidebarContent(path, page.load);
+ };
+
+ page.load = function () {
+ 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);
+ });