Move remaining inline changeset JS to changeset.js
This commit is contained in:
parent
898bc32f48
commit
cabdb65191
2 changed files with 33 additions and 35 deletions
|
@ -1,6 +1,7 @@
|
||||||
var highlight;
|
$(document).ready(function () {
|
||||||
|
var highlight;
|
||||||
|
|
||||||
function highlightChangeset(id) {
|
function highlightChangeset(id) {
|
||||||
var feature = vectors.getFeatureByFid(id);
|
var feature = vectors.getFeatureByFid(id);
|
||||||
var bounds = feature.geometry.getBounds();
|
var bounds = feature.geometry.getBounds();
|
||||||
|
|
||||||
|
@ -20,15 +21,14 @@ function highlightChangeset(id) {
|
||||||
vectors.addFeatures(highlight);
|
vectors.addFeatures(highlight);
|
||||||
|
|
||||||
$("#tr-changeset-" + id).addClass("selected");
|
$("#tr-changeset-" + id).addClass("selected");
|
||||||
}
|
}
|
||||||
|
|
||||||
function unHighlightChangeset(id) {
|
function unHighlightChangeset(id) {
|
||||||
vectors.removeFeatures(highlight);
|
vectors.removeFeatures(highlight);
|
||||||
|
|
||||||
$("#tr-changeset-" + id).removeClass("selected");
|
$("#tr-changeset-" + id).removeClass("selected");
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
var map = createMap("changeset_list_map", {
|
var map = createMap("changeset_list_map", {
|
||||||
controls: [
|
controls: [
|
||||||
new OpenLayers.Control.Navigation(),
|
new OpenLayers.Control.Navigation(),
|
||||||
|
@ -72,4 +72,12 @@ $(document).ready(function () {
|
||||||
} else {
|
} else {
|
||||||
map.zoomToExtent(proj(bounds));
|
map.zoomToExtent(proj(bounds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("[data-changeset]").mouseover(function() {
|
||||||
|
highlightChangeset($(this).data("changeset").id);
|
||||||
|
});
|
||||||
|
|
||||||
|
$("[data-changeset]").mouseout(function() {
|
||||||
|
unHighlightChangeset($(this).data("changeset").id);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -48,13 +48,3 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
$("#tr-changeset-<%= changeset.id%>").mouseover(function() {
|
|
||||||
highlightChangeset("<%= changeset.id %>");
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#tr-changeset-<%= changeset.id%>").mouseout(function() {
|
|
||||||
unHighlightChangeset("<%= changeset.id %>");
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue