- function loadHistory() {
- $(this).attr("href", "").text(I18n.t('browse.start_rjs.wait'));
-
- var feature = selectedLayer.feature;
-
- $.ajax({
- url: "/api/" + OSM.API_VERSION + "/" + feature.type + "/" + feature.id + "/history",
- success: function (xml) {
- if (selectedLayer.feature != feature || $("#browse_content").firstChild == browseObjectList) {
- return;
- }
-
- $(this).remove();
-
- var history = [];
- var nodes = xml.getElementsByTagName(feature.type);
- for (var i = nodes.length - 1; i >= 0; i--) {
- history.push({
- user: nodes[i].getAttribute("user") || I18n.t('browse.start_rjs.private_user'),
- timestamp: nodes[i].getAttribute("timestamp")
- });
- }
-
- $("#browse_content").append(JST["templates/browse/feature_history"]({
- name: featureNameHistory(feature),
- url: "/browse/" + feature.type + "/" + feature.id,
- history: history
- }));
- }.bind(this)
- });
-
- return false;
+ function onSelect(layer) {
+ // Unselect previously selected feature
+ if (selectedLayer) {
+ selectedLayer.setStyle(selectedLayer.originalStyle);