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